Partager via


X509Util.GetKey Method

Gets the private key for the specified X.509 certificate if available; otherwise the public key.

Namespace: Microsoft.Web.Services3.Security.X509
Assembly: Microsoft.Web.Services3 (in microsoft.web.services3.dll)

Usage

'Usage
Dim certificate As X509Certificate2
Dim returnValue As RSA
returnValue = X509Util.GetKey(certificate)

Syntax

'Declaration
Public Shared Function GetKey( _
    ByVal certificate As X509Certificate2 _
) As RSA
public static RSA GetKey(
    X509Certificate2 certificate
);
public:
static RSA^ GetKey(
    X509Certificate2^ certificate
);
public static RSA GetKey(
    X509Certificate2 certificate
);
public static function GetKey(
     certificate : X509Certificate2
) : RSA;

Parameters

  • certificate
    A System.Security.Cryptography.X509Certificates.X509Certificate2 that represents the X.509 certificate to get the key from.

Return Value

A System.Security.Cryptography.RSA that represents the private key for certificate if available; otherwise the public key.

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.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows 2000, Windows 2000 Server, Windows 2000 Advanced Server

Target Platforms

See Also

Reference

X509Util Class
X509Util Members
Microsoft.Web.Services3.Security.X509 Namespace