Class Pkcs12Generator
Class for PKCS#12 store generation
Inherited Members
Namespace: Lacuna.Pki.Stores
Assembly: Lacuna.Pki.dll
Syntax
public class Pkcs12Generator
Constructors
Pkcs12Generator()
Declaration
public Pkcs12Generator()
Methods
AddCertificateEntry(String, PKCertificate)
Adds a certificate entry to PKCS#12 store
Declaration
public void AddCertificateEntry(string alias, PKCertificate certificate)
Parameters
Type | Name | Description |
---|---|---|
String | alias | Alias entry |
PKCertificate | certificate | Certifcate |
AddCertificateEntry(String, X509Certificate)
Adds a certificate entry to PKCS#12 store
Declaration
public void AddCertificateEntry(string alias, X509Certificate certificate)
Parameters
Type | Name | Description |
---|---|---|
String | alias | Alias entry |
X509Certificate | certificate | Certifcate |
AddKeyEntry(String, PrivateKey, PKCertificate, IEnumerable<PKCertificate>)
Adds a key entry to PKCS#12 store
Declaration
public void AddKeyEntry(string alias, PrivateKey privateKey, PKCertificate certificate, IEnumerable<PKCertificate> caCertificates = null)
Parameters
Type | Name | Description |
---|---|---|
String | alias | Alias entry |
PrivateKey | privateKey | Private key |
PKCertificate | certificate | Certificate associated with the private key |
IEnumerable<PKCertificate> | caCertificates | CA certificates chain |
AddKeyEntry(String, AsymmetricAlgorithm, PKCertificate, IEnumerable<PKCertificate>)
Adds a key entry to PKCS#12 store
Declaration
public void AddKeyEntry(string alias, AsymmetricAlgorithm privateKey, PKCertificate certificate, IEnumerable<PKCertificate> caCertificates = null)
Parameters
Type | Name | Description |
---|---|---|
String | alias | Alias entry |
AsymmetricAlgorithm | privateKey | Private key |
PKCertificate | certificate | Certificate associated with the private key |
IEnumerable<PKCertificate> | caCertificates | CA certificates chain |
AddKeyEntry(String, AsymmetricAlgorithm, IEnumerable<PKCertificate>)
Adds a key entry to PKCS#12 store
Declaration
[Obsolete("Use overload with separate certificate and CA certificates")]
public void AddKeyEntry(string alias, AsymmetricAlgorithm privateKey, IEnumerable<PKCertificate> certificates)
Parameters
Type | Name | Description |
---|---|---|
String | alias | Alias entry |
AsymmetricAlgorithm | privateKey | Private key |
IEnumerable<PKCertificate> | certificates | Certificate chain. If more than one certificate, the certificate associated with the privateKey MUST come in the first position |
AddKeyEntry(String, AsymmetricAlgorithm, IEnumerable<X509Certificate>)
Adds a key entry to PKCS#12 store
Declaration
[Obsolete("Use overload with separate certificate and CA certificates")]
public void AddKeyEntry(string alias, AsymmetricAlgorithm privateKey, IEnumerable<X509Certificate> certificates)
Parameters
Type | Name | Description |
---|---|---|
String | alias | Alias entry |
AsymmetricAlgorithm | privateKey | Private key |
IEnumerable<X509Certificate> | certificates | Certificate chain. If more than one certificate, the certificate associated with the privateKey MUST come in the first position |
Generate(String)
Generates the PKCS#12 content
Declaration
public byte[] Generate(string password)
Parameters
Type | Name | Description |
---|---|---|
String | password | Password for key encryption |
Returns
Type | Description |
---|---|
Byte[] | PKCS#12 content bytes |