Class PKICRLSource
java.lang.Object
eu.europa.esig.dss.pki.x509.revocation.crl.PKICRLSource
- All Implemented Interfaces:
CRLSource,RevocationSource<CRL>,Serializable
An implementation of the CRLSource interface that provides methods to obtain Certificate Revocation Lists (CRLs)
for certificate revocation checks. The CRLs are retrieved based on the CertEntity (certificate entity) and
optionally specified production and next update dates.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPKICRLSource(CertEntityRepository<? extends CertEntity> certEntityRepository) Creates a PKICRLSource instance with a CRL issuer being the issuer certificate token provided on the CRL requestPKICRLSource(CertEntityRepository<? extends CertEntity> certEntityRepository, CertEntity crlIssuer) Creates a PKICRLSource instance with enforced CRL signerCertEntity -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddRevocationsToCRL(org.bouncycastle.cert.X509v2CRLBuilder builder, Map<CertEntity, CertEntityRevocation> revocationList) Adds revocations to the CRL builder based on the provided CertEntity and revocationList.protected booleancanGenerate(CertificateToken certificateToken, CertificateToken issuerCertificateToken) Returns whether the current implementation is able to produce a CRL for the givencertificateTokenprotected CRLBinarygenerateCRL(CertEntity crlIssuer) Generates a CRL token and returns encoded binariesprotected CertEntitygetCrlIssuer(CertificateToken certificateToken, CertificateToken issuerCertificateToken) Returns aCertEntityto be used as an CRL issuer.Gets nextUpdate valuegetRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken) Retrieves a Certificate Revocation List (CRL) token for the given certificate and its issuer certificate if the CertEntity is not already.protected SignatureAlgorithmgetSignatureAlgorithm(CertEntity crlIssuer) Returns a signature algorithm to be used on CRL creationprotected DateGets thisUpdate value.voidsetCrlIssuer(CertEntity crlIssuer) Sets a CertEntity to be used as a CRL issuer.voidsetDigestAlgorithm(DigestAlgorithm digestAlgorithm) Sets Digest Algorithm to be used on CRL request signature Default: SHA512 (DigestAlgorithm.SHA512)voidsetEncryptionAlgorithm(EncryptionAlgorithm encryptionAlgorithm) Sets encryption algorithm to be used on CRL signature generation.voidsetMaskGenerationFunction(MaskGenerationFunction maskGenerationFunction) Deprecated.since DSS 6.1.voidsetNextUpdate(Date nextUpdate) Set the next update date for the CRL generation.voidsetThisUpdate(Date thisUpdate) Set the production date for the CRL generation.
-
Constructor Details
-
PKICRLSource
Creates a PKICRLSource instance with a CRL issuer being the issuer certificate token provided on the CRL request- Parameters:
certEntityRepository-CertEntityRepository
-
PKICRLSource
public PKICRLSource(CertEntityRepository<? extends CertEntity> certEntityRepository, CertEntity crlIssuer) Creates a PKICRLSource instance with enforced CRL signerCertEntity- Parameters:
certEntityRepository-CertEntityRepositorycrlIssuer-CertEntityto issue CRL
-
-
Method Details
-
getNextUpdate
-
setNextUpdate
Set the next update date for the CRL generation. If not set, the nextUpdate field will not be added to CRL.- Parameters:
nextUpdate- The next update date to be set.
-
getThisUpdate
-
setThisUpdate
Set the production date for the CRL generation.- Parameters:
thisUpdate- The production date to be set.
-
setDigestAlgorithm
Sets Digest Algorithm to be used on CRL request signature Default: SHA512 (DigestAlgorithm.SHA512)- Parameters:
digestAlgorithm-DigestAlgorithm
-
setEncryptionAlgorithm
Sets encryption algorithm to be used on CRL signature generation. If not defined, the encryption algorithm from the givenCertEntityCRL issuer will be used. NOTE: It is important to ensure that the defined encryption algorithm is supported by the CRL issuer.- Parameters:
encryptionAlgorithm-EncryptionAlgorithm
-
setMaskGenerationFunction
Deprecated.since DSS 6.1. Please usesetEncryptionAlgorithmmethod to specify RSA (none MGF) or RSASSA-PSS (MGF1) algorithmSets mask generation function to be used on CRL signature generation NOTE: The used encryption algorithm should support the given parameter.- Parameters:
maskGenerationFunction-MaskGenerationFunction
-
getCrlIssuer
protected CertEntity getCrlIssuer(CertificateToken certificateToken, CertificateToken issuerCertificateToken) Returns aCertEntityto be used as an CRL issuer.- Parameters:
certificateToken-CertificateTokento request CRL forissuerCertificateToken-CertificateTokenissued thecertificateToken- Returns:
CertEntityrepresenting the entry to be used as an issuer of the CRL
-
setCrlIssuer
Sets a CertEntity to be used as a CRL issuer. If not defined, the certificate issuer will be used as a CRL issuing certificate.- Parameters:
crlIssuer-CertEntity
-
getRevocationToken
public CRLToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken) Retrieves a Certificate Revocation List (CRL) token for the given certificate and its issuer certificate if the CertEntity is not already.- Specified by:
getRevocationTokenin interfaceCRLSource- Specified by:
getRevocationTokenin interfaceRevocationSource<CRL>- Parameters:
certificateToken- The CertificateToken representing the certificate to be checked for revocation.issuerCertificateToken- The CertificateToken representing the issuer certificate of the certificate to be verified.- Returns:
- The CRLToken representing the revocation status of the certificate.
-
canGenerate
protected boolean canGenerate(CertificateToken certificateToken, CertificateToken issuerCertificateToken) Returns whether the current implementation is able to produce a CRL for the givencertificateToken- Parameters:
certificateToken-CertificateTokento produce a CRL forissuerCertificateToken-CertificateTokenrepresenting an issuer of thecertificateToken- Returns:
- TRUE if the current implementation is able to produce a CRL for the given pair, FALSE otherwise
-
generateCRL
protected CRLBinary generateCRL(CertEntity crlIssuer) throws IOException, org.bouncycastle.operator.OperatorCreationException Generates a CRL token and returns encoded binaries- Parameters:
crlIssuer-CertEntityissuer of the CRL- Returns:
CRLBinaryrepresenting a DER-encoded CRL token- Throws:
IOException- if an exception occurs on CRL generationorg.bouncycastle.operator.OperatorCreationException- if an exception occurs on CRL signing
-
getSignatureAlgorithm
Returns a signature algorithm to be used on CRL creation- Parameters:
crlIssuer-CertEntityto sign the CRL- Returns:
SignatureAlgorithm
-
addRevocationsToCRL
protected void addRevocationsToCRL(org.bouncycastle.cert.X509v2CRLBuilder builder, Map<CertEntity, CertEntityRevocation> revocationList) Adds revocations to the CRL builder based on the provided CertEntity and revocationList.- Parameters:
builder- The X509v2CRLBuilder instance to which the entries will be added.revocationList- List of Revocation objects containing the revocation information.
-