This documentation is archived and is not being maintained.

PackageDigitalSignatureManager Class

Provides a utility class for the creation and verification of digital signatures in a Package.


Namespace:  System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)

public sealed class PackageDigitalSignatureManager

The PackageDigitalSignatureManager type exposes the following members.

Public methodPackageDigitalSignatureManagerInitializes a new instance of the PackageDigitalSignatureManager class for use with a specified Package.

Public propertyCertificateOptionGets or sets the X.509 certificate embedding option used by the Sign method to digitally sign package parts.
Public propertyStatic memberDefaultHashAlgorithmGets a URI string that identifies the default hash algorithm used to create and verify signatures.
Public propertyHashAlgorithmGets or sets the URI identifier for the HashAlgorithm instance used to create and verify signatures.
Public propertyIsSignedGets a value that indicates whether the package contains any signatures.
Public propertyParentWindowGets or sets a handle to the parent window for displaying a certificate selection dialog box.
Public propertySignatureOriginGets the uniform resource identifier (URI) of the signature origin part.
Public propertyStatic memberSignatureOriginRelationshipTypeGets the type of default signature origin relationship.
Public propertySignaturesGets a collection of all the signatures contained in the package.
Public propertyTimeFormatGets or sets the date/time format used to create a signature SigningTime.
Public propertyTransformMappingGets a dictionary that contains each defined ContentType and its associated XML Transform.Algorithm identifier.

Public methodCountersign()Countersigns all the signatures in the package with a user-selected X.509 certificate.
Public methodCountersign(X509Certificate)Countersigns all the signatures in the package with a specified X.509 certificate.
Public methodCountersign(X509Certificate, IEnumerable<Uri>)Countersigns a list of signatures with a given X.509 certificate.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetSignatureReturns the digital signature for a given signature uniform resource identifier (URI). 
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemoveAllSignaturesRemoves all digital signatures from the package.
Public methodRemoveSignatureRemoves the digital signature with a given signature uniform resource identifier (URI). 
Public methodSign(IEnumerable<Uri>)Prompts the user for an X.509 certificate, which is then used to digitally sign a specified list of package parts.
Public methodSign(IEnumerable<Uri>, X509Certificate)Signs a list of package parts with a given X.509 certificate.
Public methodSign(IEnumerable<Uri>, X509Certificate, IEnumerable<PackageRelationshipSelector>)Signs a list of package parts and package relationships with a given X.509 certificate.
Public methodSign(IEnumerable<Uri>, X509Certificate, IEnumerable<PackageRelationshipSelector>, String)Signs a list of package parts and package relationships with a given X.509 certificate and identifier (ID).
Public methodSign(IEnumerable<Uri>, X509Certificate, IEnumerable<PackageRelationshipSelector>, String, IEnumerable<DataObject>, IEnumerable<Reference>)Signs a list of package parts, package relationships, or custom objects with a specified X.509 certificate and signature identifier (ID).
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodStatic memberVerifyCertificateVerifies a given X.509 certificate.
Public methodVerifySignaturesVerifies the signatures on all signed parts within the package.

Public eventInvalidSignatureEventOccurs when VerifySignatures encounters an invalid signature.

PackageDigitalSignatureManager builds on the architecture of Microsoft .NET Framework digital signature classes and provides a utility class for performing common tasks in using digital signatures with Package elements.

For more information about package digital signatures, see the MSDN article Digital Signing Framework of the Open Packaging Conventions available at

The following example shows how to use the PackageDigitalSignatureManager. For the complete sample, see Creating a Package with a Digital Signature Sample.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.