Share via


SecIdentity.Import Method

Definition

Overloads

Name Description
Import(X509Certificate2)
Import(Byte[], String)

Create a SecIdentity from PKCS #12 data.

Import(X509Certificate2)

public static Security.SecIdentity Import(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
static member Import : System.Security.Cryptography.X509Certificates.X509Certificate2 -> Security.SecIdentity

Parameters

certificate
X509Certificate2

Returns

Applies to

Import(Byte[], String)

Create a SecIdentity from PKCS #12 data.

public static Security.SecIdentity Import(byte[] data, string password);
static member Import : byte[] * string -> Security.SecIdentity

Parameters

data
Byte[]

The PKCS #12 blob data as a byte array.

password
String

The password for the private key in the PKCS #12 data. An empty password is not supported.

Returns

Remarks

On macOS 14 or earlier this method requires access to the default keychain,where the private key + certificate will be stored.

On macOS 15 or later, as well as all other platforms (iOS, tvOS, Mac Catalyst), calling this method will not affect any keychains (a temporary, in-memory keychain is created for the duration of the import).

Applies to