Class PadesSigner
Class for creating PAdES signatures
Assembly: Lacuna.Pki.dll
Syntax
Constructors
PadesSigner()
Declaration
Properties
ValidationResults
Declaration
public ValidationResults ValidationResults { get; }
Property Value
Methods
AddAttributeCertificate(AttributeCertificate)
Declaration
public void AddAttributeCertificate(AttributeCertificate attributeCertificate)
Parameters
Adds a PDF metdata key and value
Declaration
public void AddMetadata(string key, string value)
Parameters
Type |
Name |
Description |
String |
key |
Metadata key
|
String |
value |
Metadata value
|
ComputeSignature()
Declaration
public void ComputeSignature()
GetPadesSignature()
Declaration
public byte[] GetPadesSignature()
Returns
GetToSignBytes(out SignatureAlgorithm, out Byte[])
Declaration
public byte[] GetToSignBytes(out SignatureAlgorithm signatureAlgorithm, out byte[] transferData)
Parameters
Returns
SetCertificateStore(ICertificateStore)
Declaration
public void SetCertificateStore(ICertificateStore certStore)
Parameters
SetCertificateValidationConfigurator(Action<CertificateValidationOptions>)
Sets an action for configuring the signer certificate validation
Declaration
public void SetCertificateValidationConfigurator(Action<CertificateValidationOptions> configureCertificateValidation)
Parameters
SetCertificationLevel(PadesCertificationLevel)
Declaration
public void SetCertificationLevel(PadesCertificationLevel certLevel)
Parameters
SetCommitmentType(CommitmentType)
Sets the signer commitment type signed attribute
Declaration
public void SetCommitmentType(CommitmentType commitmentType)
Parameters
SetCustomSignatureFieldName(String)
(Optional) Sets a custom signature unique field name. Default is "SignatureX" where X is incremental on each signer starting at 1.
Declaration
public void SetCustomSignatureFieldName(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
SetLocation(String)
(Optional) Sets the PDF signing location. The CPU host name or physical location of the signing.
Declaration
public void SetLocation(string location)
Parameters
Type |
Name |
Description |
String |
location |
|
SetPdfToSign(Byte[])
Declaration
public void SetPdfToSign(byte[] content)
Parameters
Type |
Name |
Description |
Byte[] |
content |
|
SetPdfToSign(Stream)
Declaration
public void SetPdfToSign(Stream stream)
Parameters
Type |
Name |
Description |
Stream |
stream |
|
SetPdfToSign(String)
Declaration
public void SetPdfToSign(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
SetPolicy(IPadesPolicyMapper)
Declaration
public void SetPolicy(IPadesPolicyMapper mapper)
Parameters
SetPolicy(PadesPolicySpec)
Declaration
public void SetPolicy(PadesPolicySpec policy)
Parameters
SetPreComputedSignature(Byte[], Byte[])
Sets pre-computed signature from the client. Used in a remote key signature
Declaration
public void SetPreComputedSignature(byte[] signature, byte[] padesTransferData)
Parameters
Type |
Name |
Description |
Byte[] |
signature |
|
Byte[] |
padesTransferData |
|
SetReason(String)
(Optional) Sets the PDF signing reason field
Declaration
public void SetReason(string reason)
Parameters
Type |
Name |
Description |
String |
reason |
|
SetSignerName(String)
(Optional) Sets the PDF signer name.
PDF 32000-1:2008: The name of the person or authority signing the document.
This value should be used ONLY WHEN it is not possible to extract the name from the signature (From the certificate of the signer.)
Declaration
public void SetSignerName(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
SetSigningCertificate(PKCertificate)
Declaration
public void SetSigningCertificate(PKCertificate certificate)
Parameters
SetSigningCertificate(PKCertificateWithKey)
Declaration
public void SetSigningCertificate(PKCertificateWithKey certificate)
Parameters
SetTimestampRequester(ITimestampRequester)
Declaration
public void SetTimestampRequester(ITimestampRequester tsRequester)
Parameters
SetUseRandomAccessArrayMethod(Boolean)
Use in case of huge PDF files passed as byte array
Declaration
public void SetUseRandomAccessArrayMethod(bool useRandomAccessMethod)
Parameters
Type |
Name |
Description |
Boolean |
useRandomAccessMethod |
|
SetVisualRepresentation(PadesVisualRepresentation)
Declaration
[Obsolete("Use SetVisualRepresentation(PadesVisualSignature2 visualRepresentation) instead")]
public void SetVisualRepresentation(PadesVisualRepresentation visualRepresentation)
Parameters
SetVisualRepresentation(PadesVisualRepresentation2)
Declaration
public void SetVisualRepresentation(PadesVisualRepresentation2 visualRepresentation)
Parameters
VerifyParameters(Boolean)
Verifies if PadesSigner necessary parameters are set. If not, throws Exception.
Declaration
public void VerifyParameters(bool computingSignature = false)
Parameters
Type |
Name |
Description |
Boolean |
computingSignature |
Whether or not you will call the ComputeSignature() method to complete the siganture process in this step.
|