{"record":{"id":"a2b298633dfd7660","repo":"dotnet/wpf","slug":"sr-packagesignaturereferencetagrequired","errorCode":null,"errorMessage":"SR.PackageSignatureReferenceTagRequired","messagePattern":"SR\\.PackageSignatureReferenceTagRequired","errorType":"exception","errorClass":"XmlException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/XmlDigitalSignatureProcessor.cs","lineNumber":1203,"sourceCode":"                            packageReferenceFound = true;\n                    }\n\n                    currentTransformChain = currentReference.TransformChain;\n\n                    for(int j=0; j<currentTransformChain.Count; j++)\n                    {\n                        //As per the OPC spec, only two transforms are supported for the reference tags\n                        if (!IsValidXmlCanonicalizationTransform(currentTransformChain[j].Algorithm))\n                            throw new XmlException(SR.UnsupportedTransformAlgorithm);\n                    }\n                }\n                else\n                    throw new XmlException(SR.InvalidUriAttribute);\n            }\n\n            // If there are zero reference tags or if there wasn't any package specific reference tag            \n            if (allowPackageSpecificReferences && !packageReferenceFound)\n                throw new XmlException(SR.PackageSignatureReferenceTagRequired);\n        }\n\n\n        //------------------------------------------------------\n        //\n        //  Private Members\n        //\n        //------------------------------------------------------\n        private PackagePart _signaturePart;\n        private X509Certificate2                    _certificate;       // non-null if it's embedded\n        private bool                                _lookForEmbeddedCert;\n        private PackageDigitalSignatureManager      _manager;\n        private PackageDigitalSignature             _signature;         // parsed from part or newly created\n        private SignedXml                           _signedXml;         // our format friend\n        private String                              _hashAlgorithmName;     // first hash algorithm obtained - considered to be the setting for the entire signature\n\n        // OPC Object tag parsing - once parsed, all fields in this section are considered viable\n        private bool                            _dataObjectParsed;          // true if package-specific data Object tag has been parsed","sourceCodeStart":1185,"sourceCodeEnd":1221,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/XmlDigitalSignatureProcessor.cs#L1185-L1221","documentation":"ValidateReferences throws this XmlException when a package-specific reference lacks the required <Transform> canonicalization algorithm tag or otherwise does not carry the mandatory package signature reference tag required by the OPC spec.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/IO/Packaging/XmlDigitalSignatureProcessor.cs:1203 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Apply only supported canonicalization transforms (e.g. XML C14N) to package references when creating signatures","Strip unsupported transforms before verification, or reject the signature","Re-sign the package with compliant transform algorithms"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}