X509CertificateLoader.LoadPkcs12Collection Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
LoadPkcs12Collection(Byte[], String, X509KeyStorageFlags, Pkcs12LoaderLimits) |
Loads the provided data as a PKCS#12 PFX and returns a collection of all of the certificates therein. |
LoadPkcs12Collection(ReadOnlySpan<Byte>, ReadOnlySpan<Char>, X509KeyStorageFlags, Pkcs12LoaderLimits) |
Loads the provided data as a PKCS#12 PFX and returns a collection of all of the certificates therein. |
LoadPkcs12Collection(Byte[], String, X509KeyStorageFlags, Pkcs12LoaderLimits)
- Source:
- X509CertificateLoader.cs
- Source:
- X509CertificateLoader.cs
Loads the provided data as a PKCS#12 PFX and returns a collection of all of the certificates therein.
public static System.Security.Cryptography.X509Certificates.X509Certificate2Collection LoadPkcs12Collection (byte[] data, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet, System.Security.Cryptography.X509Certificates.Pkcs12LoaderLimits? loaderLimits = default);
static member LoadPkcs12Collection : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags * System.Security.Cryptography.X509Certificates.Pkcs12LoaderLimits -> System.Security.Cryptography.X509Certificates.X509Certificate2Collection
Public Shared Function LoadPkcs12Collection (data As Byte(), password As String, Optional keyStorageFlags As X509KeyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet, Optional loaderLimits As Pkcs12LoaderLimits = Nothing) As X509Certificate2Collection
Parameters
- data
- Byte[]
The data to load.
- password
- String
The password to decrypt the contents of the PFX.
- keyStorageFlags
- X509KeyStorageFlags
A bitwise combination of the enumeration values that control where and how to import the private key associated with the returned certificate.
- loaderLimits
- Pkcs12LoaderLimits
Limits to apply when loading the PFX. A null
value, the default,
is equivalent to Defaults.
Returns
A collection of the certificates loaded from the input.
Exceptions
data
is null
.
keyStorageFlags
contains a value, or combination of values,
that is not valid.
keyStorageFlags
contains a value that is not valid for the
current platform.
The PKCS#12/PFX violated one or more constraints of loaderLimits
.
An error occurred while loading the PKCS#12/PFX.
Applies to
LoadPkcs12Collection(ReadOnlySpan<Byte>, ReadOnlySpan<Char>, X509KeyStorageFlags, Pkcs12LoaderLimits)
- Source:
- X509CertificateLoader.cs
- Source:
- X509CertificateLoader.cs
Loads the provided data as a PKCS#12 PFX and returns a collection of all of the certificates therein.
public static System.Security.Cryptography.X509Certificates.X509Certificate2Collection LoadPkcs12Collection (ReadOnlySpan<byte> data, ReadOnlySpan<char> password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet, System.Security.Cryptography.X509Certificates.Pkcs12LoaderLimits? loaderLimits = default);
static member LoadPkcs12Collection : ReadOnlySpan<byte> * ReadOnlySpan<char> * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags * System.Security.Cryptography.X509Certificates.Pkcs12LoaderLimits -> System.Security.Cryptography.X509Certificates.X509Certificate2Collection
Public Shared Function LoadPkcs12Collection (data As ReadOnlySpan(Of Byte), password As ReadOnlySpan(Of Char), Optional keyStorageFlags As X509KeyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet, Optional loaderLimits As Pkcs12LoaderLimits = Nothing) As X509Certificate2Collection
Parameters
- data
- ReadOnlySpan<Byte>
The data to load.
- password
- ReadOnlySpan<Char>
The password to decrypt the contents of the PFX.
- keyStorageFlags
- X509KeyStorageFlags
A bitwise combination of the enumeration values that control where and how to import the private key associated with the returned certificate.
- loaderLimits
- Pkcs12LoaderLimits
Limits to apply when loading the PFX. A null
value, the default,
is equivalent to Defaults.
Returns
A collection of the certificates loaded from the input.
Exceptions
data
is null
.
keyStorageFlags
contains a value, or combination of values,
that is not valid.
keyStorageFlags
contains a value that is not valid for the
current platform.
The PKCS#12/PFX violated one or more constraints of loaderLimits
.
An error occurred while loading the PKCS#12/PFX.