Class ValidatorChainBuilder
java.lang.Object
com.itextpdf.signatures.validation.v1.ValidatorChainBuilder
A builder class to construct all necessary parts of a validation chain
The builder can be reused to create multiple instances of a validator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CertificateChainValidator
private IssuingCertificateRetriever
private CRLValidator
private OCSPValidator
private SignatureValidationProperties
private RevocationDataValidator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a newCertificateChainValidator
instance.Create a newCRLValidator
instance.Create a newOCSPValidator
instance.Create a newRevocationDataValidator
instance This method can be used to create multiple validators.(package private) SignatureValidator
buildSignatureValidator
(PdfDocument document) Create a newSignatureValidator
instance with the current configuration.(package private) CertificateChainValidator
Retrieves the explicitly added or automatically createdCertificateChainValidator
instance.Retrieves the explicitly added or automatically createdIssuingCertificateRetriever
instance.(package private) CRLValidator
Retrieves the explicitly added or automatically createdCRLValidator
instance.(package private) OCSPValidator
Retrieves the explicitly added or automatically createdOCSPValidator
instance.Retrieves the explicitly added or automatically createdSignatureValidationProperties
instance.(package private) RevocationDataValidator
Retrieves the explicitly added or automatically createdRevocationDataValidator
instance.withCertificateChainValidator
(CertificateChainValidator certificateChainValidator) Use this instance of aCertificateChainValidator
in the validation chain.withCRLValidator
(CRLValidator crlValidator) Use this instance of aCRLValidator
in the validation chain.withIssuingCertificateRetriever
(IssuingCertificateRetriever certificateRetriever) Use this instance of aIssuingCertificateRetriever
in the validation chain.withKnownCertificates
(Collection<Certificate> knownCertificates) Adds known certificates to theIssuingCertificateRetriever
.withOCSPValidator
(OCSPValidator ocspValidator) Use this instance of aOCSPValidator
in the validation chain.withRevocationDataValidator
(RevocationDataValidator revocationDataValidator) Use this instance of aRevocationDataValidator
in the validation chain.Use this instance of aSignatureValidationProperties
in the validation chain.withTrustedCertificates
(Collection<Certificate> trustedCertificates) Sets the trusted certificates to theIssuingCertificateRetriever
.
-
Field Details
-
properties
-
certificateRetriever
-
certificateChainValidator
-
revocationDataValidator
-
ocspValidator
-
crlValidator
-
-
Constructor Details
-
ValidatorChainBuilder
public ValidatorChainBuilder()
-
-
Method Details
-
buildSignatureValidator
Create a newSignatureValidator
instance with the current configuration. This method can be used to create multiple validators.- Parameters:
document
- ThePdfDocument
to create the signatureValidator for.- Returns:
- a new instance of a signature validator
-
buildCertificateChainValidator
Create a newCertificateChainValidator
instance. This method can be used to create multiple validators.- Returns:
- a new instance of a CertificateChainValidator
-
buildRevocationDataValidator
Create a newRevocationDataValidator
instance This method can be used to create multiple validators.- Returns:
- a new instance of a RevocationDataValidator
-
buildOCSPValidator
Create a newOCSPValidator
instance. This method can be used to create multiple validators.- Returns:
- a new instance of a OCSPValidator
-
buildCRLValidator
Create a newCRLValidator
instance. This method can be used to create multiple validators.- Returns:
- a new instance of a CRLValidator
-
withCRLValidator
Use this instance of aCRLValidator
in the validation chain.- Parameters:
crlValidator
- the CRLValidator instance to use- Returns:
- the current ValidatorChainBuilder
-
withOCSPValidator
Use this instance of aOCSPValidator
in the validation chain.- Parameters:
ocspValidator
- the OCSPValidator instance to use- Returns:
- the current ValidatorChainBuilder
-
withRevocationDataValidator
public ValidatorChainBuilder withRevocationDataValidator(RevocationDataValidator revocationDataValidator) Use this instance of aRevocationDataValidator
in the validation chain.- Parameters:
revocationDataValidator
- the RevocationDataValidator instance to use- Returns:
- the current ValidatorChainBuilder
-
withCertificateChainValidator
public ValidatorChainBuilder withCertificateChainValidator(CertificateChainValidator certificateChainValidator) Use this instance of aCertificateChainValidator
in the validation chain.- Parameters:
certificateChainValidator
- the CertificateChainValidator instance to use- Returns:
- the current ValidatorChainBuilder
-
withSignatureValidationProperties
public ValidatorChainBuilder withSignatureValidationProperties(SignatureValidationProperties properties) Use this instance of aSignatureValidationProperties
in the validation chain.- Parameters:
properties
- the SignatureValidationProperties instance to use- Returns:
- the current ValidatorChainBuilder
-
withIssuingCertificateRetriever
public ValidatorChainBuilder withIssuingCertificateRetriever(IssuingCertificateRetriever certificateRetriever) Use this instance of aIssuingCertificateRetriever
in the validation chain.- Parameters:
certificateRetriever
- the IssuingCertificateRetriever instance to use- Returns:
- the current ValidatorChainBuilder
-
withKnownCertificates
Adds known certificates to theIssuingCertificateRetriever
.- Parameters:
knownCertificates
- the list of known certificates to add- Returns:
- the current ValidatorChainBuilder
-
withTrustedCertificates
Sets the trusted certificates to theIssuingCertificateRetriever
.- Parameters:
trustedCertificates
- the list of trusted certificates to set- Returns:
- the current ValidatorChainBuilder
-
getCertificateChainValidator
CertificateChainValidator getCertificateChainValidator()Retrieves the explicitly added or automatically createdCertificateChainValidator
instance.- Returns:
- the explicitly added or automatically created
CertificateChainValidator
instance
-
getRevocationDataValidator
RevocationDataValidator getRevocationDataValidator()Retrieves the explicitly added or automatically createdRevocationDataValidator
instance.- Returns:
- the explicitly added or automatically created
RevocationDataValidator
instance
-
getCRLValidator
CRLValidator getCRLValidator()Retrieves the explicitly added or automatically createdCRLValidator
instance.- Returns:
- the explicitly added or automatically created
CRLValidator
instance
-
getOCSPValidator
OCSPValidator getOCSPValidator()Retrieves the explicitly added or automatically createdOCSPValidator
instance.- Returns:
- the explicitly added or automatically created
OCSPValidator
instance
-
getCertificateRetriever
Retrieves the explicitly added or automatically createdIssuingCertificateRetriever
instance.- Returns:
- the explicitly added or automatically created
IssuingCertificateRetriever
instance
-
getProperties
Retrieves the explicitly added or automatically createdSignatureValidationProperties
instance.- Returns:
- the explicitly added or automatically created
SignatureValidationProperties
instance
-