.NET Framework Class Library
PackageDigitalSignatureManager Class

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

Inheritance Hierarchy
SystemObject
  System.IO.PackagingPackageDigitalSignatureManager

Namespace:   System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)
Syntax
Public NotInheritable Class PackageDigitalSignatureManager
public sealed class PackageDigitalSignatureManager
public ref class PackageDigitalSignatureManager sealed
[<[%$TOPIC/ms571904_en-us_VS_110_3_0_3_0_0%]>]
type PackageDigitalSignatureManager =  class end

The PackageDigitalSignatureManager type exposes the following members.

Constructors
  NameDescription
Public method PackageDigitalSignatureManagerInitializes a new instance of the PackageDigitalSignatureManager class for use with a specified Package.
Top
Properties
  NameDescription
Public property CertificateOptionGets or sets the X.509 certificate embedding option used by the Sign method to digitally sign package parts.
Public property Static member DefaultHashAlgorithmGets a URI string that identifies the default hash algorithm used to create and verify signatures.
Public property HashAlgorithmGets or sets the URI identifier for the HashAlgorithm instance used to create and verify signatures.
Public property IsSignedGets a value that indicates whether the package contains any signatures.
Public property ParentWindowGets or sets a handle to the parent window for displaying a certificate selection dialog box.
Public property SignatureOriginGets the uniform resource identifier (URI) of the signature origin part.
Public property Static member SignatureOriginRelationshipTypeGets the type of default signature origin relationship.
Public property SignaturesGets a collection of all the signatures contained in the package.
Public property TimeFormatGets or sets the date/time format used to create a signature SigningTime.
Public property TransformMappingGets a dictionary that contains each defined ContentType and its associated XML  Transform. Algorithm identifier.
Top
Methods
  NameDescription
Public method CountersignCountersigns all the signatures in the package with a user-selected X.509 certificate.
Public method Countersign(X509Certificate)Countersigns all the signatures in the package with a specified X.509 certificate.
Public method Countersign(X509Certificate, IEnumerableUri)Countersigns a list of signatures with a given X.509 certificate.
Public method Equals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method GetHashCodeServes as the default hash function. (Inherited from Object.)
Public method GetSignatureReturns the digital signature for a given signature uniform resource identifier (URI). 
Public method GetTypeGets the Type of the current instance. (Inherited from Object.)
Public method RemoveAllSignaturesRemoves all digital signatures from the package.
Public method RemoveSignatureRemoves the digital signature with a given signature uniform resource identifier (URI). 
Public method Sign(IEnumerableUri)Prompts the user for an X.509 certificate, which is then used to digitally sign a specified list of package parts.
Public method Sign(IEnumerableUri, X509Certificate)Signs a list of package parts with a given X.509 certificate.
Public method Sign(IEnumerableUri, X509Certificate, IEnumerablePackageRelationshipSelector)Signs a list of package parts and package relationships with a given X.509 certificate.
Public method Sign(IEnumerableUri, X509Certificate, IEnumerablePackageRelationshipSelector, String)Signs a list of package parts and package relationships with a given X.509 certificate and identifier (ID).
Public method Sign(IEnumerableUri, X509Certificate, IEnumerablePackageRelationshipSelector, String, IEnumerableDataObject, IEnumerableReference)Signs a list of package parts, package relationships, or custom objects with a specified X.509 certificate and signature identifier (ID).
Public method ToStringReturns a string that represents the current object. (Inherited from Object.)
Public method Static member VerifyCertificateVerifies a given X.509 certificate.
Public method VerifySignaturesVerifies the signatures on all signed parts within the package.
Top
Events
  NameDescription
Public event InvalidSignatureEventOccurs when VerifySignatures encounters an invalid signature.
Top
Remarks

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 http://go.microsoft.com/fwlink/?LinkId=74494.

Examples

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

Version Information

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

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