/// <summary> /// Factory method that creates a new PackageDigitalSignature /// </summary> internal static PackageDigitalSignature Sign( PackageDigitalSignatureManager manager, PackagePart signaturePart, IEnumerable<Uri> parts, IEnumerable<PackageRelationshipSelector> relationshipSelectors, X509Certificate2 signer, String signatureId, bool embedCertificate, IEnumerable<System.Security.Cryptography.Xml.DataObject> signatureObjects, IEnumerable<System.Security.Cryptography.Xml.Reference> objectReferences) { // create XmlDigitalSignatureProcessor p = new XmlDigitalSignatureProcessor(manager, signaturePart); // and sign return p.Sign(parts, relationshipSelectors, signer, signatureId, embedCertificate, signatureObjects, objectReferences); }
/// <summary> /// Constructor for use when opening an existing signature /// </summary> /// <param name="manager">digital signature manager - to consult for hash, embedding and other options</param> /// <param name="signaturePart">part that houses the signature</param> internal PackageDigitalSignature( PackageDigitalSignatureManager manager, PackagePart signaturePart) { _manager = manager; _processor = new XmlDigitalSignatureProcessor(manager, signaturePart, this); }
//------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ /// <summary> /// Constructor for creating a new signature /// </summary> /// <param name="manager">digital signature manager - to consult for hash, embedding and other options</param> /// <param name="processor">digital signature manager - to consult for hash, embedding and other options</param> internal PackageDigitalSignature( PackageDigitalSignatureManager manager, XmlDigitalSignatureProcessor processor) { Debug.Assert(processor.PackageSignature == null, "Logic Error: one processor per-signature"); _manager = manager; _processor = processor; // _processor.PackageSignature = this; }