GetPublicKey Method

SignedXml.GetPublicKey Method ()


Returns the public key of a signature.

Namespace:   System.Security.Cryptography.Xml
Assembly:  System.Security (in System.Security.dll)

protected virtual AsymmetricAlgorithm GetPublicKey()

Return Value

Type: System.Security.Cryptography.AsymmetricAlgorithm

An AsymmetricAlgorithm object that contains the public key of the signature, or null if the key cannot be found.

Exception Condition

The KeyInfo property is null.

The GetPublicKey method returns an AsymmetricAlgorithm object that contains a public key that can be used to verify an XML digital signature.

The key must be either a DSA or an RSA key.

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft