Show / Hide Table of Contents

Class PadesSigner

Class for creating PAdES signatures

Inheritance
Object
PadesSigner
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: Lacuna.Pki.Pades
Assembly: Lacuna.Pki.dll
Syntax
public class PadesSigner

Constructors

PadesSigner()

Declaration
public PadesSigner()

Properties

ValidationResults

Declaration
public ValidationResults ValidationResults { get; }
Property Value
Type Description
ValidationResults

Methods

AddAttributeCertificate(AttributeCertificate)

Declaration
public void AddAttributeCertificate(AttributeCertificate attributeCertificate)
Parameters
Type Name Description
AttributeCertificate attributeCertificate

AddMetadata(String, String)

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
Type Description
Byte[]

GetToSignBytes(out SignatureAlgorithm, out Byte[])

Declaration
public byte[] GetToSignBytes(out SignatureAlgorithm signatureAlgorithm, out byte[] transferData)
Parameters
Type Name Description
SignatureAlgorithm signatureAlgorithm
Byte[] transferData
Returns
Type Description
Byte[]

SetCertificateStore(ICertificateStore)

Declaration
public void SetCertificateStore(ICertificateStore certStore)
Parameters
Type Name Description
ICertificateStore certStore

SetCertificateValidationConfigurator(Action<CertificateValidationOptions>)

Sets an action for configuring the signer certificate validation

Declaration
public void SetCertificateValidationConfigurator(Action<CertificateValidationOptions> configureCertificateValidation)
Parameters
Type Name Description
Action<CertificateValidationOptions> configureCertificateValidation

SetCertificationLevel(PadesCertificationLevel)

Declaration
public void SetCertificationLevel(PadesCertificationLevel certLevel)
Parameters
Type Name Description
PadesCertificationLevel certLevel

SetCommitmentType(CommitmentType)

Sets the signer commitment type signed attribute

Declaration
public void SetCommitmentType(CommitmentType commitmentType)
Parameters
Type Name Description
CommitmentType commitmentType

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
Type Name Description
IPadesPolicyMapper mapper

SetPolicy(PadesPolicySpec)

Declaration
public void SetPolicy(PadesPolicySpec policy)
Parameters
Type Name Description
PadesPolicySpec policy

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
Type Name Description
PKCertificate certificate

SetSigningCertificate(PKCertificateWithKey)

Declaration
public void SetSigningCertificate(PKCertificateWithKey certificate)
Parameters
Type Name Description
PKCertificateWithKey certificate

SetTimestampRequester(ITimestampRequester)

Declaration
public void SetTimestampRequester(ITimestampRequester tsRequester)
Parameters
Type Name Description
ITimestampRequester tsRequester

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
Type Name Description
PadesVisualRepresentation visualRepresentation

SetVisualRepresentation(PadesVisualRepresentation2)

Declaration
public void SetVisualRepresentation(PadesVisualRepresentation2 visualRepresentation)
Parameters
Type Name Description
PadesVisualRepresentation2 visualRepresentation

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.

Back to top Copyright © 2015-2020 Lacuna Software