Class RevocationToken
- java.lang.Object
-
- eu.europa.esig.dss.model.x509.Token
-
- eu.europa.esig.dss.spi.x509.revocation.RevocationToken
-
- All Implemented Interfaces:
Serializable
public abstract class RevocationToken extends Token
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DatearchiveCutOffprotected booleanavailableThis boolean shows if the online resource is availableprotected booleancertHashMatchRepresents if the certHash extension from an OCSP Response is match with the related certificate's hash (optional)protected booleancertHashPresentRepresents if the certHash extension from an OCSP Response is present (optional)protected DateexpiredCertsOnCRLprotected DatenextUpdateRepresents the next update date of the CRL or null for OCSP response.protected DateproductionDateRepresents the production date of the OCSP response or the thisUpdate in case of CRL.protected RevocationReasonreasonThe reason of the revocation.protected CertificateTokenrelatedCertificateRelatedCertificateTokento this revocation objectprotected DaterevocationDateRepresents the revocation date from an X509CRLEntry or from an BasicOCSPResp (if the related certificate is revoked)protected StringrevocationTokenKeyRevocation Token Key, used forRevocationTokenidentification (i.e.protected RevocationTyperevocationTypeAn identifier referencing a CRL or OCSP response has been used for determining the revocation status.protected StringsourceURLThe URL which was used to obtain the revocation data (online).protected BooleanstatusContains the revocation status of the token.protected DatethisUpdateRepresents the this update date of the CRL.-
Fields inherited from class eu.europa.esig.dss.model.x509.Token
publicKeyOfTheSigner, signatureAlgorithm, signatureInvalidityReason, signatureValid
-
-
Constructor Summary
Constructors Constructor Description RevocationToken()
-
Method Summary
Modifier and Type Method Description booleanequals(Object obj)DategetArchiveCutOff()Returns the archiveCutOff date (from an OCSP Response)DategetCreationDate()Returns the creation date of this token.StringgetDSSIdAsString()Returns a string representation of the unique DSS token identifier.DategetExpiredCertsOnCRL()Returns the expiredCertsOnCRL date (from CRL)RevocationOrigingetFirstOrigin()Returns first found origin from the set ofRevocationOriginsDategetNextUpdate()Returns the date of the next updateSet<RevocationOrigin>getOrigins()Returns the revocation origin (the signature itself or else)DategetProductionDate()Returns the generation time of the current revocation data (when it was signed)RevocationReasongetReason()Returns the revocation reason (if the token has been revoked)StringgetRelatedCertificateID()DategetRevocationDate()Returns the revocation date (if the token has been revoked)StringgetRevocationTokenKey()Returns compiled revocation token keyRevocationTypegetRevocationType()StringgetSourceURL()Returns the URL of the source (if available)BooleangetStatus()Returns the revocation statusDategetThisUpdate()inthashCode()abstract voidinitInfo()Initialize inner attributesbooleanisAvailable()Returns the online resource availability statusbooleanisCertHashMatch()Returns TRUE if the certHash extension (from an OCSP Response) is match to the hash of related certificate tokenbooleanisCertHashPresent()Returns TRUE if the certHash extension (from an OCSP Response) is presentabstract booleanisValid()Indicates if the token signature is intact and the signing certificate matches with the signature and if the extended key usage is present.voidsetAvailable(boolean available)voidsetOrigins(Set<RevocationOrigin> origins)voidsetRelatedCertificate(CertificateToken relatedCertificate)voidsetRevocationTokenKey(String key)Sets the value for revocationTokenKeyvoidsetSourceURL(String sourceURL)This sets the revocation data source URL.-
Methods inherited from class eu.europa.esig.dss.model.x509.Token
checkIsSignedBy, getAbbreviation, getDigest, getDSSId, getEncoded, getIssuerX500Principal, getPublicKeyOfTheSigner, getSignatureAlgorithm, isSelfSigned, isSignatureValid, isSignedBy, toString, toString
-
-
-
-
Field Detail
-
relatedCertificate
protected CertificateToken relatedCertificate
RelatedCertificateTokento this revocation object
-
revocationType
protected RevocationType revocationType
An identifier referencing a CRL or OCSP response has been used for determining the revocation status.
-
sourceURL
protected String sourceURL
The URL which was used to obtain the revocation data (online).
-
available
protected boolean available
This boolean shows if the online resource is available
-
status
protected Boolean status
Contains the revocation status of the token. True if is not revoked, false if is revoked or null if unknown.
-
productionDate
protected Date productionDate
Represents the production date of the OCSP response or the thisUpdate in case of CRL.
-
thisUpdate
protected Date thisUpdate
Represents the this update date of the CRL.
-
nextUpdate
protected Date nextUpdate
Represents the next update date of the CRL or null for OCSP response.
-
revocationDate
protected Date revocationDate
Represents the revocation date from an X509CRLEntry or from an BasicOCSPResp (if the related certificate is revoked)
-
expiredCertsOnCRL
protected Date expiredCertsOnCRL
-
archiveCutOff
protected Date archiveCutOff
-
certHashPresent
protected boolean certHashPresent
Represents if the certHash extension from an OCSP Response is present (optional)
-
certHashMatch
protected boolean certHashMatch
Represents if the certHash extension from an OCSP Response is match with the related certificate's hash (optional)
-
reason
protected RevocationReason reason
The reason of the revocation.
-
revocationTokenKey
protected String revocationTokenKey
Revocation Token Key, used forRevocationTokenidentification (i.e. id in DB)
-
-
Method Detail
-
getRevocationType
public RevocationType getRevocationType()
-
getRelatedCertificateID
public String getRelatedCertificateID()
-
setRelatedCertificate
public void setRelatedCertificate(CertificateToken relatedCertificate)
-
getSourceURL
public String getSourceURL()
Returns the URL of the source (if available)- Returns:
- URL of the CRL/OCSP Server (if available)
-
setSourceURL
public void setSourceURL(String sourceURL)
This sets the revocation data source URL. It is only used in case ofOnlineSource.- Parameters:
sourceURL- the URL which was used to retrieve this CRL
-
getOrigins
public Set<RevocationOrigin> getOrigins()
Returns the revocation origin (the signature itself or else)- Returns:
- the origin of this revocation data
-
getFirstOrigin
public RevocationOrigin getFirstOrigin()
Returns first found origin from the set ofRevocationOrigins- Returns:
RevocationOrigin
-
setOrigins
public void setOrigins(Set<RevocationOrigin> origins)
-
isAvailable
public boolean isAvailable()
Returns the online resource availability status- Returns:
- true if the online resource was available
-
setAvailable
public void setAvailable(boolean available)
-
getStatus
public Boolean getStatus()
Returns the revocation status- Returns:
- true if valid, false if revoked/onhold, null if not available
-
getProductionDate
public Date getProductionDate()
Returns the generation time of the current revocation data (when it was signed)- Returns:
- the production time of the current revocation data
-
getCreationDate
public Date getCreationDate()
Description copied from class:TokenReturns the creation date of this token. This date is mainly used to retrieve the correct issuer within a collection of renewed certificates (new certificate with the same key pair).- Specified by:
getCreationDatein classToken- Returns:
- the creation date of the token (notBefore for a certificate, productionDate for revocation data,...)
-
getThisUpdate
public Date getThisUpdate()
-
getNextUpdate
public Date getNextUpdate()
Returns the date of the next update- Returns:
- the next update date
-
getRevocationDate
public Date getRevocationDate()
Returns the revocation date (if the token has been revoked)- Returns:
- the revocation date or null
-
getExpiredCertsOnCRL
public Date getExpiredCertsOnCRL()
Returns the expiredCertsOnCRL date (from CRL)- Returns:
- the expiredCertsOnCRL date value from a CRL or null
-
getArchiveCutOff
public Date getArchiveCutOff()
Returns the archiveCutOff date (from an OCSP Response)- Returns:
- the archiveCutOff date or null
-
isCertHashPresent
public boolean isCertHashPresent()
Returns TRUE if the certHash extension (from an OCSP Response) is present- Returns:
- the TRUE if certHash is present, FALSE otherwise
-
isCertHashMatch
public boolean isCertHashMatch()
Returns TRUE if the certHash extension (from an OCSP Response) is match to the hash of related certificate token- Returns:
- the TRUE if certHash is match, FALSE otherwise
-
getReason
public RevocationReason getReason()
Returns the revocation reason (if the token has been revoked)- Returns:
- the revocation reason or null
-
getRevocationTokenKey
public String getRevocationTokenKey()
Returns compiled revocation token key- Returns:
Stringkey
-
setRevocationTokenKey
public void setRevocationTokenKey(String key)
Sets the value for revocationTokenKey- Parameters:
key-String
-
initInfo
public abstract void initInfo()
Initialize inner attributes
-
isValid
public abstract boolean isValid()
Indicates if the token signature is intact and the signing certificate matches with the signature and if the extended key usage is present.- Returns:
trueif the conditions are meet
-
getDSSIdAsString
public String getDSSIdAsString()
Description copied from class:TokenReturns a string representation of the unique DSS token identifier.- Overrides:
getDSSIdAsStringin classToken- Returns:
- the unique string for the token
-
-