X509Certificate Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Provides methods that help you use X.509 version 3 certificates.

Inheritance Hierarchy

System.Object
  System.Security.Cryptography.X509Certificates.X509Certificate

Namespace:  System.Security.Cryptography.X509Certificates
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<ComVisibleAttribute(True)> _
Public Class X509Certificate
[ComVisibleAttribute(true)]
public class X509Certificate

The X509Certificate type exposes the following members.

Constructors

  Name Description
Public methodSupported by Silverlight for Windows Phone X509Certificate() Initializes a new instance of the X509Certificate class.
Public methodSupported by Silverlight for Windows Phone X509Certificate(array<Byte[]) Initializes a new instance of the X509Certificate class defined from a sequence of bytes representing an X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone X509Certificate(IntPtr) Security Critical. Initializes a new instance of the X509Certificate class using a handle to an unmanaged PCCERT_CONTEXT structure.
Public methodSupported by Silverlight for Windows Phone X509Certificate(String) Security Critical. Initializes a new instance of the X509Certificate class using a using a certificate file name.
Public methodSupported by Silverlight for Windows Phone X509Certificate(X509Certificate) Initializes a new instance of the X509Certificate class using another X509Certificate class.
Public methodSupported by Silverlight for Windows Phone X509Certificate(array<Byte[], String) Initializes a new instance of the X509Certificate class using a byte array and a password.
Public methodSupported by Silverlight for Windows Phone X509Certificate(String, String) Security Critical. Initializes a new instance of the X509Certificate class by using a certificate file name and a password to access the certificate.
Public methodSupported by Silverlight for Windows Phone X509Certificate(array<Byte[], String, X509KeyStorageFlags) Initializes a new instance of the X509Certificate class using a byte array, a password, and a key storage flag.
Public methodSupported by Silverlight for Windows Phone X509Certificate(String, String, X509KeyStorageFlags) Security Critical. Initializes a new instance of the X509Certificate class using a certificate file name, a password used to access the certificate, and a key storage flag.

Top

Properties

  Name Description
Public propertySupported by Silverlight for Windows Phone Handle Gets a handle to a Microsoft Cryptographic API certificate context described by an unmanaged PCCERT_CONTEXT structure.
Public propertySupported by Silverlight for Windows Phone Issuer Gets the name of the certificate authority that issued the X.509 version 3 certificate.
Public propertySupported by Silverlight for Windows Phone Subject Gets the subject distinguished name from the certificate.

Top

Methods

  Name Description
Public methodStatic memberSupported by Silverlight for Windows Phone CreateFromCertFile Security Critical. Creates an X.509 version 3 certificate from the specified certification file.
Protected methodSupported by Silverlight for Windows Phone CreateHexString Infrastructure. Creates a hexadecimal string from the specified byte array.
Public methodSupported by Silverlight for Windows Phone Equals(Object) Compares two X509Certificate objects for equality. (Overrides Object.Equals(Object).)
Public methodSupported by Silverlight for Windows Phone Equals(X509Certificate) Compares two X509Certificate objects for equality.
Public methodSupported by Silverlight for Windows Phone Export(X509ContentType) Exports the current X509Certificate object to a byte array in a format described by one of the X509ContentType values.
Public methodSupported by Silverlight for Windows Phone Export(X509ContentType, String) Exports the current X509Certificate object to a byte array in a format described by one of the X509ContentType values, and using the specified password.
Protected methodSupported by Silverlight for Windows Phone Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetCertHash Returns the hash value for the X.509 version 3 certificate as an array of bytes.
Public methodSupported by Silverlight for Windows Phone GetCertHashString Returns the hash value for the X.509 version 3 certificate as a hexadecimal string.
Public methodSupported by Silverlight for Windows Phone GetEffectiveDateString Returns the effective date of this X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetExpirationDateString Returns the expiration date of this X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetFormat Returns the name of the format of this X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetHashCode Returns the hash code for the X.509 version 3 certificate as an integer. (Overrides Object.GetHashCode().)
Public methodSupported by Silverlight for Windows Phone GetKeyAlgorithm Returns the key algorithm information for this X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetKeyAlgorithmParameters Returns the key algorithm parameters for the X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetKeyAlgorithmParametersString Returns the key algorithm parameters for the X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetPublicKey Returns the public key for the X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetPublicKeyString Returns the public key for the X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetRawCertData Returns the raw data for the entire X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetRawCertDataString Returns the raw data for the entire X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetSerialNumber Returns the serial number of the X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetSerialNumberString Returns the serial number of the X.509 version 3 certificate.
Public methodSupported by Silverlight for Windows Phone GetType Gets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone Import(array<Byte[]) Populates the X509Certificate object with data from a byte array.
Public methodSupported by Silverlight for Windows Phone Import(String) Security Critical. Populates the X509Certificate object with information from a certificate file.
Public methodSupported by Silverlight for Windows Phone Import(array<Byte[], String, X509KeyStorageFlags) Populates the X509Certificate object using data from a byte array, a password, and flags for determining how the private key is imported.
Public methodSupported by Silverlight for Windows Phone Import(String, String, X509KeyStorageFlags) Security Critical. Populates the X509Certificate object with information from a certificate file, a password, and a X509KeyStorageFlags value.
Protected methodSupported by Silverlight for Windows Phone MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone ToString() Returns a string representation of the current X509Certificate object. (Overrides Object.ToString().)
Public methodSupported by Silverlight for Windows Phone ToString(Boolean) Returns a string representation of the current X509Certificate object, with extra information, if specified.

Top

Remarks

ASN.1 DER is the only certificate format supported by this class.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

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.