Class OCSPToken
java.lang.Object
eu.europa.esig.dss.spi.x509.revocation.RevocationToken<eu.europa.esig.dss.model.x509.revocation.ocsp.OCSP>
eu.europa.esig.dss.spi.x509.revocation.ocsp.OCSPToken
- All Implemented Interfaces:
Serializable
OCSP Signed Token which encapsulate BasicOCSPResp (BC).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PublicKeyprotected eu.europa.esig.dss.enumerations.SignatureAlgorithmprotected Stringprotected eu.europa.esig.dss.enumerations.SignatureValidityFields inherited from class RevocationToken
archiveCutOff, certHashMatch, certHashPresent, crlNumber, expiredCertsOnCRL, externalOrigin, nextUpdate, productionDate, reason, relatedCertificate, revocationDate, sourceURL, status, thisUpdate -
Constructor Summary
ConstructorsConstructorDescriptionOCSPToken(org.bouncycastle.cert.ocsp.BasicOCSPResp basicOCSPResp, org.bouncycastle.cert.ocsp.SingleResp latestSingleResp, eu.europa.esig.dss.model.x509.CertificateToken certificate, eu.europa.esig.dss.model.x509.CertificateToken issuer) The default constructor to instantiate an OCSPToken with BasicOCSPResp only -
Method Summary
Modifier and TypeMethodDescriptionprotected eu.europa.esig.dss.enumerations.SignatureValiditycheckIsSignedBy(PublicKey publicKey) Verifies if the current OCSP token has been signed by the specified publicKeyorg.bouncycastle.cert.ocsp.BasicOCSPRespReturns theBasicOCSPRespList<eu.europa.esig.dss.model.x509.CertificateToken> Returns a collection of embedded certificates.Returns a source of embedded into a revocation token certificatesbyte[]getDigest(eu.europa.esig.dss.enumerations.DigestAlgorithm arg0) eu.europa.esig.dss.model.identifier.TokenIdentifiergetDSSId()byte[]eu.europa.esig.dss.model.x509.CertificateTokenReturns issuerCertificateTokeneu.europa.esig.dss.model.identifier.EntityIdentifierorg.bouncycastle.cert.ocsp.SingleRespReturns the latest single responseintThis method returns version defined within the OCSP token (returns version value + 1, i.e.eu.europa.esig.dss.enumerations.RevocationTypeReturns the Revocation Token type (CRL or OCSP)eu.europa.esig.dss.enumerations.SignatureAlgorithmeu.europa.esig.dss.enumerations.SignatureValiditybooleanbooleanbooleanisSignedBy(eu.europa.esig.dss.model.x509.CertificateToken arg0) booleanisSignedBy(PublicKey arg0) booleanisValid()Indicates if the OCSP token is valid.toString()Methods inherited from class RevocationToken
buildTokenIdentifier, equals, getArchiveCutOff, getCreationDate, getCRLNumber, getExpiredCertsOnCRL, getExternalOrigin, getNextUpdate, getProductionDate, getReason, getRelatedCertificate, getRelatedCertificateId, getRevocationDate, getSourceURL, getStatus, getThisUpdate, hashCode, isCertHashMatch, isCertHashPresent, isInternal, setExternalOrigin, setSourceURL
-
Field Details
-
publicKeyOfTheSigner
-
signatureValidity
protected eu.europa.esig.dss.enumerations.SignatureValidity signatureValidity -
signatureInvalidityReason
-
signatureAlgorithm
protected eu.europa.esig.dss.enumerations.SignatureAlgorithm signatureAlgorithm
-
-
Constructor Details
-
OCSPToken
public OCSPToken(org.bouncycastle.cert.ocsp.BasicOCSPResp basicOCSPResp, org.bouncycastle.cert.ocsp.SingleResp latestSingleResp, eu.europa.esig.dss.model.x509.CertificateToken certificate, eu.europa.esig.dss.model.x509.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
public eu.europa.esig.dss.enumerations.SignatureAlgorithm getSignatureAlgorithm() -
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:RevocationTokenReturns a source of embedded into a revocation token certificates- Specified by:
getCertificateSourcein classRevocationToken<eu.europa.esig.dss.model.x509.revocation.ocsp.OCSP>- Returns:
RevocationCertificateSource
-
getCertificates
Description copied from class:RevocationTokenReturns a collection of embedded certificates. NOTE: returns empty collection for CRL.- Specified by:
getCertificatesin classRevocationToken<eu.europa.esig.dss.model.x509.revocation.ocsp.OCSP>- Returns:
- a list of
CertificateTokens
-
getEncoded
public byte[] getEncoded() -
getIssuerX500Principal
-
getIssuerCertificateToken
public eu.europa.esig.dss.model.x509.CertificateToken getIssuerCertificateToken()Description copied from class:RevocationTokenReturns issuerCertificateToken- Specified by:
getIssuerCertificateTokenin classRevocationToken<eu.europa.esig.dss.model.x509.revocation.ocsp.OCSP>- Returns:
- issuer
CertificateToken
-
isValid
public boolean isValid()Indicates if the OCSP token is valid. NOTE: The method isSignedBy(token) must be called before!- Returns:
- whether the OCSP token is valid
-
checkIsSignedBy
-
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
public eu.europa.esig.dss.enumerations.RevocationType getRevocationType()Description copied from class:RevocationTokenReturns the Revocation Token type (CRL or OCSP)- Specified by:
getRevocationTypein classRevocationToken<eu.europa.esig.dss.model.x509.revocation.ocsp.OCSP>- Returns:
RevocationTypeof the token
-
getAbbreviation
-
toString
-
isSelfSigned
public boolean isSelfSigned() -
getDSSId
public eu.europa.esig.dss.model.identifier.TokenIdentifier getDSSId() -
getDSSIdAsString
-
isSignedBy
public boolean isSignedBy(eu.europa.esig.dss.model.x509.CertificateToken arg0) -
isSignedBy
-
getIssuerEntityKey
public eu.europa.esig.dss.model.identifier.EntityIdentifier getIssuerEntityKey() -
isSignatureIntact
public boolean isSignatureIntact() -
getSignatureValidity
public eu.europa.esig.dss.enumerations.SignatureValidity getSignatureValidity() -
getInvalidityReason
-
getPublicKeyOfTheSigner
-
toString
-
getDigest
public byte[] getDigest(eu.europa.esig.dss.enumerations.DigestAlgorithm arg0)
-