Class OCSPToken
java.lang.Object
eu.europa.esig.dss.model.x509.Token
eu.europa.esig.dss.spi.x509.revocation.RevocationToken<OCSP>
eu.europa.esig.dss.spi.x509.revocation.ocsp.OCSPToken
- All Implemented Interfaces:
Serializable
public class OCSPToken extends RevocationToken<OCSP>
OCSP Signed Token which encapsulate BasicOCSPResp (BC).
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class eu.europa.esig.dss.spi.x509.revocation.RevocationToken
archiveCutOff, certHashMatch, certHashPresent, expiredCertsOnCRL, externalOrigin, nextUpdate, productionDate, reason, relatedCertificate, revocationDate, revocationTokenKey, sourceURL, status, thisUpdate
Fields inherited from class eu.europa.esig.dss.model.x509.Token
publicKeyOfTheSigner, signatureAlgorithm, signatureInvalidityReason, signatureValidity
-
Constructor Summary
Constructors Constructor Description OCSPToken(org.bouncycastle.cert.ocsp.BasicOCSPResp basicOCSPResp, org.bouncycastle.cert.ocsp.SingleResp latestSingleResp, CertificateToken certificate, CertificateToken issuer)
The default constructor to instantiate an OCSPToken with BasicOCSPResp only -
Method Summary
Modifier and Type Method Description protected SignatureValidity
checkIsSignedBy(CertificateToken candidate)
Verifies if the current token has been signed by the specified certificateTokenString
getAbbreviation()
This method returns the DSS abbreviation of the token.org.bouncycastle.cert.ocsp.BasicOCSPResp
getBasicOCSPResp()
OCSPCertificateSource
getCertificateSource()
Returns a source of embedded into a revocation token certificatesbyte[]
getEncoded()
Returns the encoded form of the wrapped token.CertificateToken
getIssuerCertificateToken()
Returns issuerCertificateToken
X500Principal
getIssuerX500Principal()
Returns theX500Principal
of the certificate which was used to sign this token.org.bouncycastle.cert.ocsp.SingleResp
getLatestSingleResp()
String
getRevocationTokenKey()
Returns compiled revocation token keyRevocationType
getRevocationType()
Returns the Revocation Token type (CRL or OCSP)SignatureAlgorithm
getSignatureAlgorithm()
Returns the algorithm that was used to sign the token (ex: SHA1WithRSAEncryption, SHA1withRSA...).boolean
isSignedBy(CertificateToken token)
Checks if the token is signed by the given token in the parameter.boolean
isValid()
Indicates if the token signature is intact.String
toString(String indentStr)
Returns a string representation of the token.Methods inherited from class eu.europa.esig.dss.spi.x509.revocation.RevocationToken
buildTokenIdentifier, equals, getArchiveCutOff, getCreationDate, getExpiredCertsOnCRL, getExternalOrigin, getNextUpdate, getProductionDate, getReason, getRelatedCertificateID, getRevocationDate, getSourceURL, getStatus, getThisUpdate, hashCode, isCertHashMatch, isCertHashPresent, isInternal, setExternalOrigin, setRelatedCertificate, setRevocationTokenKey, setSourceURL
Methods inherited from class eu.europa.esig.dss.model.x509.Token
getDigest, getDSSId, getDSSIdAsString, getPublicKeyOfTheSigner, getSignatureValidity, isSelfSigned, toString
-
Constructor Details
-
OCSPToken
public OCSPToken(org.bouncycastle.cert.ocsp.BasicOCSPResp basicOCSPResp, org.bouncycastle.cert.ocsp.SingleResp latestSingleResp, CertificateToken certificate, CertificateToken issuer)The default constructor to instantiate an OCSPToken with BasicOCSPResp only- Parameters:
basicOCSPResp
-BasicOCSPResp
containing the response binarieslatestSingleResp
-SingleResp
to be used with the current certificatecertificate
-CertificateToken
to which the revocation data is provided forissuer
-CertificateToken
issued thecertificateToken
-
-
Method Details
-
getSignatureAlgorithm
Description copied from class:Token
Returns the algorithm that was used to sign the token (ex: SHA1WithRSAEncryption, SHA1withRSA...).- Overrides:
getSignatureAlgorithm
in classToken
- Returns:
- the used signature algorithm to sign this token
-
getRevocationTokenKey
Description copied from class:RevocationToken
Returns compiled revocation token key- Overrides:
getRevocationTokenKey
in classRevocationToken<OCSP>
- Returns:
String
key
-
getBasicOCSPResp
public org.bouncycastle.cert.ocsp.BasicOCSPResp getBasicOCSPResp() -
getLatestSingleResp
public org.bouncycastle.cert.ocsp.SingleResp getLatestSingleResp() -
getCertificateSource
Description copied from class:RevocationToken
Returns a source of embedded into a revocation token certificates- Specified by:
getCertificateSource
in classRevocationToken<OCSP>
- Returns:
RevocationCertificateSource
-
getEncoded
public byte[] getEncoded()Description copied from class:Token
Returns the encoded form of the wrapped token.- Specified by:
getEncoded
in classToken
- Returns:
- the encoded form of the wrapped token
-
getIssuerX500Principal
Description copied from class:Token
Returns theX500Principal
of the certificate which was used to sign this token.- Specified by:
getIssuerX500Principal
in classToken
- Returns:
- the issuer's
X500Principal
-
getIssuerCertificateToken
Description copied from class:RevocationToken
Returns issuerCertificateToken
- Specified by:
getIssuerCertificateToken
in classRevocationToken<OCSP>
- Returns:
- issuer
CertificateToken
-
isValid
public boolean isValid()Indicates if the token signature is intact. NOTE: The method isSignedBy(token) must be called before!- Specified by:
isValid
in classRevocationToken<OCSP>
- Returns:
true
orfalse
-
isSignedBy
Description copied from class:Token
Checks if the token is signed by the given token in the parameter.- Overrides:
isSignedBy
in classToken
- Parameters:
token
- the candidate to be tested- Returns:
- true if this token is signed by the given certificate token
-
checkIsSignedBy
Description copied from class:Token
Verifies if the current token has been signed by the specified certificateToken- Specified by:
checkIsSignedBy
in classToken
- Parameters:
candidate
-CertificateToken
signed candidate- Returns:
SignatureValidity
-
getRevocationType
Description copied from class:RevocationToken
Returns the Revocation Token type (CRL or OCSP)- Specified by:
getRevocationType
in classRevocationToken<OCSP>
- Returns:
RevocationType
of the token
-
getAbbreviation
Description copied from class:Token
This method returns the DSS abbreviation of the token. It is used for debugging purpose.- Overrides:
getAbbreviation
in classToken
- Returns:
- an abbreviation for the certificate
-
toString
Description copied from class:Token
Returns a string representation of the token.
-