/// <summary>
        /// Creates a signature from the enqueued parts.
        /// </summary>
        /// <param name="configuration">The configuration of properties used to create the signature.
        /// See the documented of <see cref="SignConfigurationSet"/> for more information.</param>
        public OpcSignature Sign(SignConfigurationSet configuration)
        {
            var fileName = configuration.PublicCertificate.GetCertHashString() + ".psdsxs";

            var(allParts, signatureFile) = SignCore(fileName);
            var signingContext = new SigningContext(configuration);
            var fileManifest   = OpcSignatureManifest.Build(signingContext, allParts);
            var builder        = new XmlSignatureBuilder(signingContext);

            builder.SetFileManifest(fileManifest);
            var result = builder.Build();

            PublishSignature(result, signatureFile);
            _package.Flush();
            return(new OpcSignature(signatureFile));
        }
 /// <summary>
 /// Creates a new siging context.
 /// </summary>
 public SigningContext(SignConfigurationSet configuration)
 {
     ContextCreationTime = DateTimeOffset.Now;
     _configuration      = configuration;
 }