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, thisUpdateFields 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 SignatureValiditycheckIsSignedBy(CertificateToken candidate)Verifies if the current token has been signed by the specified certificateTokenStringgetAbbreviation()This method returns the DSS abbreviation of the token.org.bouncycastle.cert.ocsp.BasicOCSPRespgetBasicOCSPResp()OCSPCertificateSourcegetCertificateSource()Returns a source of embedded into a revocation token certificatesbyte[]getEncoded()Returns the encoded form of the wrapped token.CertificateTokengetIssuerCertificateToken()Returns issuerCertificateTokenX500PrincipalgetIssuerX500Principal()Returns theX500Principalof the certificate which was used to sign this token.org.bouncycastle.cert.ocsp.SingleRespgetLatestSingleResp()StringgetRevocationTokenKey()Returns compiled revocation token keyRevocationTypegetRevocationType()Returns the Revocation Token type (CRL or OCSP)SignatureAlgorithmgetSignatureAlgorithm()Returns the algorithm that was used to sign the token (ex: SHA1WithRSAEncryption, SHA1withRSA...).booleanisSignedBy(CertificateToken token)Checks if the token is signed by the given token in the parameter.booleanisValid()Indicates if the token signature is intact.StringtoString(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, setSourceURLMethods 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-BasicOCSPRespcontaining the response binarieslatestSingleResp-SingleRespto be used with the current certificatecertificate-CertificateTokento which the revocation data is provided forissuer-CertificateTokenissued thecertificateToken
-
-
Method Details
-
getSignatureAlgorithm
Description copied from class:TokenReturns the algorithm that was used to sign the token (ex: SHA1WithRSAEncryption, SHA1withRSA...).- Overrides:
getSignatureAlgorithmin classToken- Returns:
- the used signature algorithm to sign this token
-
getRevocationTokenKey
Description copied from class:RevocationTokenReturns compiled revocation token key- Overrides:
getRevocationTokenKeyin classRevocationToken<OCSP>- Returns:
Stringkey
-
getBasicOCSPResp
public org.bouncycastle.cert.ocsp.BasicOCSPResp getBasicOCSPResp() -
getLatestSingleResp
public org.bouncycastle.cert.ocsp.SingleResp getLatestSingleResp() -
getCertificateSource
Description copied from class:RevocationTokenReturns a source of embedded into a revocation token certificates- Specified by:
getCertificateSourcein classRevocationToken<OCSP>- Returns:
RevocationCertificateSource
-
getEncoded
public byte[] getEncoded()Description copied from class:TokenReturns the encoded form of the wrapped token.- Specified by:
getEncodedin classToken- Returns:
- the encoded form of the wrapped token
-
getIssuerX500Principal
Description copied from class:TokenReturns theX500Principalof the certificate which was used to sign this token.- Specified by:
getIssuerX500Principalin classToken- Returns:
- the issuer's
X500Principal
-
getIssuerCertificateToken
Description copied from class:RevocationTokenReturns issuerCertificateToken- Specified by:
getIssuerCertificateTokenin 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:
isValidin classRevocationToken<OCSP>- Returns:
trueorfalse
-
isSignedBy
Description copied from class:TokenChecks if the token is signed by the given token in the parameter.- Overrides:
isSignedByin 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:TokenVerifies if the current token has been signed by the specified certificateToken- Specified by:
checkIsSignedByin classToken- Parameters:
candidate-CertificateTokensigned candidate- Returns:
SignatureValidity
-
getRevocationType
Description copied from class:RevocationTokenReturns the Revocation Token type (CRL or OCSP)- Specified by:
getRevocationTypein classRevocationToken<OCSP>- Returns:
RevocationTypeof the token
-
getAbbreviation
Description copied from class:TokenThis method returns the DSS abbreviation of the token. It is used for debugging purpose.- Overrides:
getAbbreviationin classToken- Returns:
- an abbreviation for the certificate
-
toString
Description copied from class:TokenReturns a string representation of the token.
-