iText 8.0.5 API
iText.Signatures.LtvVerification Class Reference

Add verification according to PAdES-LTV (part 4). More...

Public Types

enum   Level { Level.OCSP, Level.CRL, Level.OCSP_CRL, Level.OCSP_OPTIONAL_CRL }
  What type of verification to include. More...
 
enum   CertificateOption { CertificateOption.SIGNING_CERTIFICATE, CertificateOption.WHOLE_CHAIN, CertificateOption.ALL_CERTIFICATES }
  Options for how many certificates to include. More...
 
enum   CertificateInclusion { CertificateInclusion.YES, CertificateInclusion.NO }
  Certificate inclusion in the DSS and VRI dictionaries in the CERT and CERTS keys. More...
 
enum   RevocationDataNecessity { RevocationDataNecessity.REQUIRED_FOR_SIGNING_CERTIFICATE, RevocationDataNecessity.OPTIONAL }
  Option to determine whether revocation information is required for the signing certificate. More...
 

Public Member Functions

  LtvVerification (PdfDocument document)
  The verification constructor. More...
 
virtual LtvVerification  SetRevocationDataNecessity (LtvVerification.RevocationDataNecessity revocationDataNecessity)
  Sets RevocationDataNecessity option to specify the necessity of revocation data. More...
 
virtual LtvVerification  SetIssuingCertificateRetriever (IIssuingCertificateRetriever issuingCertificateRetriever)
  Sets IIssuingCertificateRetriever instance needed to get CRL issuer certificates (using AIA extension). More...
 
virtual bool  AddVerification (String signatureName, IOcspClient ocsp, ICrlClient crl, LtvVerification.CertificateOption certOption, LtvVerification.Level level, LtvVerification.CertificateInclusion certInclude)
  Add verification for a particular signature. More...
 
virtual bool  AddVerification (String signatureName, ICollection< byte[]> ocsps, ICollection< byte[]> crls, ICollection< byte[]> certs)
  Adds verification to the signature. More...
 
virtual void  Merge ()
  Merges the validation with any validation already in the document or creates a new one. More...
 

Static Public Member Functions

static String  ConvertToHex (byte[] bytes)
  Converts an array of bytes to a String of hexadecimal values More...
 

Detailed Description

Add verification according to PAdES-LTV (part 4).

Member Enumeration Documentation

◆ CertificateInclusion

Certificate inclusion in the DSS and VRI dictionaries in the CERT and CERTS keys.

Enumerator
YES 

Include certificates in the DSS and VRI dictionaries.

NO 

Do not include certificates in the DSS and VRI dictionaries.

◆ CertificateOption

Options for how many certificates to include.

Enumerator
SIGNING_CERTIFICATE 

Include verification just for the signing certificate.

WHOLE_CHAIN 

Include verification for the whole chain of certificates.

ALL_CERTIFICATES 

Include verification for the whole certificates chain, certificates used to create OCSP responses, CRL response certificates and timestamp certificates included in the signatures.

◆ Level

What type of verification to include.

Enumerator
OCSP 

Include only OCSP.

CRL 

Include only CRL.

OCSP_CRL 

Include both OCSP and CRL.

OCSP_OPTIONAL_CRL 

Include CRL only if OCSP can't be read.

◆ RevocationDataNecessity

Option to determine whether revocation information is required for the signing certificate.

Enumerator
REQUIRED_FOR_SIGNING_CERTIFICATE 

Require revocation information for the signing certificate.

OPTIONAL 

Revocation data for the signing certificate may be optional.

Constructor & Destructor Documentation

◆ LtvVerification()

iText.Signatures.LtvVerification.LtvVerification ( PdfDocument  document )
inline

The verification constructor.

The verification constructor. This class should only be created with PdfStamper.getLtvVerification() otherwise the information will not be added to the Pdf.

Parameters
document The iText.Kernel.Pdf.PdfDocument to apply the validation to.

Member Function Documentation

◆ AddVerification() [1/2]

virtual bool iText.Signatures.LtvVerification.AddVerification ( String  signatureName,
ICollection< byte[]>  ocsps,
ICollection< byte[]>  crls,
ICollection< byte[]>  certs 
)
inlinevirtual

Adds verification to the signature.

Parameters
signatureName name of the signature
ocsps collection of DER-encoded BasicOCSPResponses
crls collection of DER-encoded CRLs
certs collection of DER-encoded certificates
Returns
boolean

◆ AddVerification() [2/2]

virtual bool iText.Signatures.LtvVerification.AddVerification ( String  signatureName,
IOcspClient  ocsp,
ICrlClient  crl,
LtvVerification.CertificateOption  certOption,
LtvVerification.Level  level,
LtvVerification.CertificateInclusion  certInclude 
)
inlinevirtual

Add verification for a particular signature.

Parameters
signatureName the signature to validate (it may be a timestamp)
ocsp the interface to get the OCSP
crl the interface to get the CRL
certOption options as to how many certificates to include
level the validation options to include
certInclude certificate inclusion options
Returns
true if a validation was generated, false otherwise

◆ ConvertToHex()

static String iText.Signatures.LtvVerification.ConvertToHex ( byte[]  bytes )
inlinestatic

Converts an array of bytes to a String of hexadecimal values

Parameters
bytes a byte array
Returns
the same bytes expressed as hexadecimal values

◆ Merge()

virtual void iText.Signatures.LtvVerification.Merge ( )
inlinevirtual

Merges the validation with any validation already in the document or creates a new one.

◆ SetIssuingCertificateRetriever()

virtual LtvVerification iText.Signatures.LtvVerification.SetIssuingCertificateRetriever ( IIssuingCertificateRetriever  issuingCertificateRetriever )
inlinevirtual

Sets IIssuingCertificateRetriever instance needed to get CRL issuer certificates (using AIA extension).

Sets IIssuingCertificateRetriever instance needed to get CRL issuer certificates (using AIA extension).

Default value is DefaultIssuingCertificateRetriever.

Parameters
issuingCertificateRetriever

IIssuingCertificateRetriever instance to set

Returns
this LtvVerification instance.

◆ SetRevocationDataNecessity()

virtual LtvVerification iText.Signatures.LtvVerification.SetRevocationDataNecessity ( LtvVerification.RevocationDataNecessity  revocationDataNecessity )
inlinevirtual

Sets RevocationDataNecessity option to specify the necessity of revocation data.

Sets RevocationDataNecessity option to specify the necessity of revocation data.

Default value is RevocationDataNecessity.OPTIONAL.

Parameters
revocationDataNecessity

RevocationDataNecessity value to set

Returns
this LtvVerification instance.