CertificateHolder.Create
CertificateHolder Create method. Creates CertificateHolder object using byte array of PKCS12 store and its password.
Create(byte[], SecureString)
Creates CertificateHolder
object using byte array of PKCS12 store and its password.
public static CertificateHolder Create(byte[] certBytes, SecureString password)
Parameter | Type | Description |
---|---|---|
certBytes | Byte[] | A byte array that contains data from an X.509 certificate. |
password | SecureString | The password required to access the X.509 certificate data. |
Return Value
An instance of CertificateHolder
Exceptions
exception | condition |
---|---|
ArgumentNullException | Thrown if certBytes is null |
ArgumentNullException | Thrown if password is null |
SecurityException | Thrown if PKCS12 store contains no aliases |
IOException | Thrown if there is wrong password or corrupted file. |
See Also
- class CertificateHolder
- namespace Wordize.DigitalSignatures
- assembly Wordize
Create(byte[], string)
Creates CertificateHolder
object using byte array of PKCS12 store and its password.
public static CertificateHolder Create(byte[] certBytes, string password)
Parameter | Type | Description |
---|---|---|
certBytes | Byte[] | A byte array that contains data from an X.509 certificate. |
password | String | The password required to access the X.509 certificate data. |
Return Value
An instance of CertificateHolder
Exceptions
exception | condition |
---|---|
ArgumentNullException | Thrown if certBytes is null |
ArgumentNullException | Thrown if password is null |
SecurityException | Thrown if PKCS12 store contains no aliases |
IOException | Thrown if there is wrong password or corrupted file. |
See Also
- class CertificateHolder
- namespace Wordize.DigitalSignatures
- assembly Wordize
Create(string, string)
Creates CertificateHolder
object using path to PKCS12 store and its password.
public static CertificateHolder Create(string fileName, string password)
Parameter | Type | Description |
---|---|---|
fileName | String | The name of a certificate file. |
password | String | The password required to access the X.509 certificate data. |
Return Value
An instance of CertificateHolder
Exceptions
exception | condition |
---|---|
ArgumentNullException | Thrown if fileName is null |
ArgumentNullException | Thrown if password is null |
SecurityException | Thrown if PKCS12 store contains no aliases |
IOException | Thrown if there is wrong password or corrupted file. |
Examples
Demonstrates how to sign document.
CertificateHolder certHolder = CertificateHolder.Create(MyDir + "morzal.pfx", "aw");
SignOptions signOptions = new SignOptions();
signOptions.Comments = "Test Signing";
signOptions.SignTime = DateTime.Now;
Signer.Sign(MyDir + "Simple.docx", ArtifactsDir + "Signed.docx", certHolder, signOptions);
See Also
- class CertificateHolder
- namespace Wordize.DigitalSignatures
- assembly Wordize
Create(string, string, string)
Creates CertificateHolder
object using path to PKCS12 store, its password and the alias by using which private key and certificate will be found.
public static CertificateHolder Create(string fileName, string password, string alias)
Parameter | Type | Description |
---|---|---|
fileName | String | The name of a certificate file. |
password | String | The password required to access the X.509 certificate data. |
alias | String | The associated alias for a certificate and its private key |
Return Value
An instance of CertificateHolder
Exceptions
exception | condition |
---|---|
ArgumentNullException | Thrown if fileName is null |
ArgumentNullException | Thrown if password is null |
SecurityException | Thrown if PKCS12 store contains no aliases |
IOException | Thrown if there is wrong password or corrupted file. |
SecurityException | Thrown if there is no private key with the given alias |
See Also
- class CertificateHolder
- namespace Wordize.DigitalSignatures
- assembly Wordize