X509Certificate2 Constructor (X509Certificate)

 

Initializes a new instance of the X509Certificate2 class using an X509Certificate object.

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

public X509Certificate2(
	X509Certificate certificate
)

Exception Condition
CryptographicException

An error with the certificate occurs. For example:

  • The certificate file does not exist.

  • The certificate is invalid.

  • The certificate's password is incorrect.

This method creates a new instance of the X509Certificate2 class using an X509Certificate object.

SecurityPermission

for accessing unmanaged code. Security action: LinkDemand. Associated enumeration: SecurityPermissionFlag.UnmanagedCode

SecurityPermission

for accessing unmanaged code. Security action: InheritanceDemand. Associated enumeration: SecurityPermissionFlag.UnmanagedCode

.NET Framework
Available since 2.0
Return to top
Show: