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:
IdentifierBasedObject
,Serializable
OCSP Signed Token which encapsulate BasicOCSPResp (BC).
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.spi.x509.revocation.RevocationToken
archiveCutOff, certHashMatch, certHashPresent, expiredCertsOnCRL, externalOrigin, nextUpdate, productionDate, reason, relatedCertificate, revocationDate, sourceURL, status, thisUpdate
Fields inherited from class eu.europa.esig.dss.model.x509.Token
publicKeyOfTheSigner, signatureAlgorithm, signatureInvalidityReason, signatureValidity
-
Constructor Summary
ConstructorDescriptionOCSPToken
(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 TypeMethodDescriptionprotected SignatureValidity
checkIsSignedBy
(PublicKey publicKey) Verifies if the current OCSP token has been signed by the specified publicKeyThis method returns the DSS abbreviation of the token.org.bouncycastle.cert.ocsp.BasicOCSPResp
Returns theBasicOCSPResp
Returns a source of embedded into a revocation token certificatesbyte[]
Returns the encoded form of the wrapped token.Returns issuerCertificateToken
Returns theX500Principal
of the certificate which was used to sign this token.org.bouncycastle.cert.ocsp.SingleResp
Returns the latest single responseint
This method returns version defined within the OCSP token (returns version value + 1, i.e.Returns the Revocation Token type (CRL or OCSP)Returns the algorithm that was used to sign the token (ex: SHA1WithRSAEncryption, SHA1withRSA...).boolean
isValid()
Indicates if the OCSP token is valid.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, getRelatedCertificate, getRelatedCertificateId, getRevocationDate, getSourceURL, getStatus, getThisUpdate, hashCode, isCertHashMatch, isCertHashPresent, isInternal, setExternalOrigin, setSourceURL
Methods inherited from class eu.europa.esig.dss.model.x509.Token
getDigest, getDSSId, getDSSIdAsString, getInvalidityReason, getPublicKeyOfTheSigner, getSignatureValidity, isSelfSigned, isSignatureIntact, isSignedBy, isSignedBy, 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
-
getBasicOCSPResp
public org.bouncycastle.cert.ocsp.BasicOCSPResp getBasicOCSPResp()Returns theBasicOCSPResp
- Returns:
BasicOCSPResp
-
getLatestSingleResp
public org.bouncycastle.cert.ocsp.SingleResp getLatestSingleResp()Returns the latest single response- Returns:
SingleResp
-
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
-
checkIsSignedBy
Verifies if the current OCSP token has been signed by the specified publicKey- Specified by:
checkIsSignedBy
in classToken
- Parameters:
publicKey
-PublicKey
of a signing candidate- Returns:
SignatureValidity
-
getOCSPTokenVersion
public int getOCSPTokenVersion()This method returns version defined within the OCSP token (returns version value + 1, i.e. 'v1' for value '0'). Returns '1' if no version defined (default value).- Returns:
- version from the basic OCSP response
-
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
-