Adds a certificate to the PFX. Can be called multiple times to add a chain.
One or more certificates
This builder for chaining
Adds a private key to the PFX. The key will be password-encrypted.
One or more private keys
This builder for chaining
Sets an optional friendly name attached to the certificate/key bags.
The friendly name
This builder for chaining
Sets the number of iterations used by PBKDF2 and the MAC derivation. Defaults to 2048.
Iteration count
This builder for chaining
Sets the password used to encrypt the private keys and compute the MAC.
The password (string or bytes)
This builder for chaining
Builder class for creating PKCS#12 (PFX) files.
Provides a fluent API for assembling certificates and private keys into a password-protected PKCS#12 container. Uses PBES2 (PBKDF2 + AES-256-CBC) for encryption and HMAC-SHA-256 with PKCS#12 password-based key derivation (RFC 7292 Appendix B) for the MAC.
Example