Saves the Certificate as a PFX encoded buffer.
Namespace: LLCryptoLib.Security.CertificatesAssembly: LLCryptoLib (in LLCryptoLib.dll) Version: 2.0.1024.0 (2.0.1024)
Syntax
C# |
---|
public byte[] ToPfxBuffer( string password, bool withPrivateKeys, bool withParents ) |
Visual Basic |
---|
Public Function ToPfxBuffer ( _ password As String, _ withPrivateKeys As Boolean, _ withParents As Boolean _ ) As Byte() |
Visual C++ |
---|
public: array<unsigned char>^ ToPfxBuffer( String^ password, bool withPrivateKeys, bool withParents ) |
Parameters
- password
- Type: System..::..String
The password to use when encrypting the private keys.
- withPrivateKeys
- Type: System..::..Boolean
true if the private keys should be exported [if possible], false otherwise.
- withParents
- Type: System..::..Boolean
true if the parent certificates should be exported too [if possible], false otherwise.
Return Value
An array of bytes that represents the PFX encoded certificate.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | password is a null reference (Nothing in Visual Basic). |
LLCryptoLib.Security.Certificates..::..CertificateException | An error occurs while exporting the certificate store -or- an error occurs while building the certificate chain -or- an error occurs while creating the store -or- an error occurs while adding the certificate to the store. |