Dela via


CertUtils.NewX509Certificate2 Method

Definition

Provides a similar API call to new X509Certificate(byte[],string,X509KeyStorageFlags)

public static System.Security.Cryptography.X509Certificates.X509Certificate2 NewX509Certificate2 (byte[] rawData, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags, bool shouldValidatePfx);
static member NewX509Certificate2 : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags * bool -> System.Security.Cryptography.X509Certificates.X509Certificate2
Public Shared Function NewX509Certificate2 (rawData As Byte(), password As String, keyStorageFlags As X509KeyStorageFlags, shouldValidatePfx As Boolean) As X509Certificate2

Parameters

rawData
Byte[]

The bytes that represent the certificate

password
String

The certificate private password

keyStorageFlags
X509KeyStorageFlags

The certificate loading options

shouldValidatePfx
Boolean

Flag to indicate if file should validated. Set to true if the rawData is retrieved from an untrusted source.

Returns

An instance of the X509Certificate

Applies to