This topic has not yet been rated - Rate this topic

X509Certificate Class

April 12, 2014

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

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

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

The X509Certificate type exposes the following members.

  NameDescription
Public methodX509Certificate()Initializes a new instance of the X509Certificate class.
Public methodX509Certificate(Byte[])Initializes a new instance of the X509Certificate class defined from a sequence of bytes representing an X.509 version 3 certificate.
Public methodX509Certificate(IntPtr)Security Critical. Initializes a new instance of the X509Certificate class using a handle to an unmanaged PCCERT_CONTEXT structure.
Public methodX509Certificate(String)Security Critical. Initializes a new instance of the X509Certificate class using a using a certificate file name.
Public methodX509Certificate(X509Certificate)Initializes a new instance of the X509Certificate class using another X509Certificate class.
Public methodX509Certificate(Byte[], String)Initializes a new instance of the X509Certificate class using a byte array and a password.
Public methodX509Certificate(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 methodX509Certificate(Byte[], String, X509KeyStorageFlags)Initializes a new instance of the X509Certificate class using a byte array, a password, and a key storage flag.
Public methodX509Certificate(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
  NameDescription
Public propertyHandleGets a handle to a Microsoft Cryptographic API certificate context described by an unmanaged PCCERT_CONTEXT structure.
Public propertyIssuerGets the name of the certificate authority that issued the X.509 version 3 certificate.
Public propertySubjectGets the subject distinguished name from the certificate.
Top
  NameDescription
Public methodStatic memberCreateFromCertFileSecurity Critical. Creates an X.509 version 3 certificate from the specified certification file.
Protected methodCreateHexStringInfrastructure. Creates a hexadecimal string from the specified byte array.
Public methodEquals(Object)Compares two X509Certificate objects for equality. (Overrides Object.Equals(Object).)
Public methodEquals(X509Certificate)Compares two X509Certificate objects for equality.
Public methodExport(X509ContentType)Exports the current X509Certificate object to a byte array in a format described by one of the X509ContentType values.
Public methodExport(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 methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetCertHashReturns the hash value for the X.509 version 3 certificate as an array of bytes.
Public methodGetCertHashStringReturns the hash value for the X.509 version 3 certificate as a hexadecimal string.
Public methodGetEffectiveDateStringReturns the effective date of this X.509 version 3 certificate.
Public methodGetExpirationDateStringReturns the expiration date of this X.509 version 3 certificate.
Public methodGetFormatReturns the name of the format of this X.509 version 3 certificate.
Public methodGetHashCodeReturns the hash code for the X.509 version 3 certificate as an integer. (Overrides Object.GetHashCode().)
Public methodGetKeyAlgorithmReturns the key algorithm information for this X.509 version 3 certificate.
Public methodGetKeyAlgorithmParametersReturns the key algorithm parameters for the X.509 version 3 certificate.
Public methodGetKeyAlgorithmParametersStringReturns the key algorithm parameters for the X.509 version 3 certificate.
Public methodGetPublicKeyReturns the public key for the X.509 version 3 certificate.
Public methodGetPublicKeyStringReturns the public key for the X.509 version 3 certificate.
Public methodGetRawCertDataReturns the raw data for the entire X.509 version 3 certificate.
Public methodGetRawCertDataStringReturns the raw data for the entire X.509 version 3 certificate.
Public methodGetSerialNumberReturns the serial number of the X.509 version 3 certificate.
Public methodGetSerialNumberStringReturns the serial number of the X.509 version 3 certificate.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodImport(Byte[])Populates the X509Certificate object with data from a byte array.
Public methodImport(String)Security Critical. Populates the X509Certificate object with information from a certificate file.
Public methodImport(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 methodImport(String, String, X509KeyStorageFlags)Security Critical. Populates the X509Certificate object with information from a certificate file, a password, and a X509KeyStorageFlags value.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToString()Returns a string representation of the current X509Certificate object. (Overrides Object.ToString().)
Public methodToString(Boolean)Returns a string representation of the current X509Certificate object, with extra information, if specified.
Top

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

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.