PackageDigitalSignatureManager.Countersign Method

Definition

Countersigns signatures in the package with a specified X.509 certificate.

Overloads

Countersign()

Countersigns all the signatures in the package with a user-selected X.509 certificate.

Countersign(X509Certificate)

Countersigns all the signatures in the package with a specified X.509 certificate.

Countersign(X509Certificate, IEnumerable<Uri>)

Countersigns a list of signatures with a given X.509 certificate.

Countersign()

Countersigns all the signatures in the package with a user-selected X.509 certificate.

public:
 System::IO::Packaging::PackageDigitalSignature ^ Countersign();
public System.IO.Packaging.PackageDigitalSignature Countersign ();
member this.Countersign : unit -> System.IO.Packaging.PackageDigitalSignature
Public Function Countersign () As PackageDigitalSignature

Returns

The signature that was added as a countersign; or null if no certificate could be located or the user canceled the certificate selection dialog.

Remarks

If no X.509 certificate is specified in the call, this method opens a certificate selection dialog box that prompts the user to choose a certificate to use for signing.

Set the window handle in the ParentWindow property before calling Countersign to make the Certificate Selection Dialog modal to the given window.

Applies to

Countersign(X509Certificate)

Countersigns all the signatures in the package with a specified X.509 certificate.

public:
 System::IO::Packaging::PackageDigitalSignature ^ Countersign(System::Security::Cryptography::X509Certificates::X509Certificate ^ certificate);
public System.IO.Packaging.PackageDigitalSignature Countersign (System.Security.Cryptography.X509Certificates.X509Certificate certificate);
member this.Countersign : System.Security.Cryptography.X509Certificates.X509Certificate -> System.IO.Packaging.PackageDigitalSignature
Public Function Countersign (certificate As X509Certificate) As PackageDigitalSignature

Parameters

certificate
X509Certificate

The X.509 certificate to add as a countersign signature.

Returns

The signature that was added as a countersign.

Exceptions

certificate is null

Applies to

Countersign(X509Certificate, IEnumerable<Uri>)

Countersigns a list of signatures with a given X.509 certificate.

public:
 System::IO::Packaging::PackageDigitalSignature ^ Countersign(System::Security::Cryptography::X509Certificates::X509Certificate ^ certificate, System::Collections::Generic::IEnumerable<Uri ^> ^ signatures);
public System.IO.Packaging.PackageDigitalSignature Countersign (System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Collections.Generic.IEnumerable<Uri> signatures);
member this.Countersign : System.Security.Cryptography.X509Certificates.X509Certificate * seq<Uri> -> System.IO.Packaging.PackageDigitalSignature
Public Function Countersign (certificate As X509Certificate, signatures As IEnumerable(Of Uri)) As PackageDigitalSignature

Parameters

certificate
X509Certificate

The X.509 certificate to countersign each of the specified signatures.

signatures
IEnumerable<Uri>

The list of signatures to countersign.

Returns

The digital signature used to countersign each of the signatures.

Exceptions

Either the certificate or signatures parameter is null.

The package contains no signed PackagePart objects.

The package contains no PackageDigitalSignature parts.

Applies to