All Implemented Interfaces:
IdentifierBasedObject, Serializable

public class OCSPToken extends RevocationToken<OCSP>
OCSP Signed Token which encapsulate BasicOCSPResp (BC).
See Also:
  • 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 binaries
      latestSingleResp - SingleResp to be used with the current certificate
      certificate - CertificateToken to which the revocation data is provided for
      issuer - CertificateToken issued the certificateToken
  • Method Details

    • getSignatureAlgorithm

      public eu.europa.esig.dss.enumerations.SignatureAlgorithm getSignatureAlgorithm()
      Overrides:
      getSignatureAlgorithm in class Token
    • getBasicOCSPResp

      public org.bouncycastle.cert.ocsp.BasicOCSPResp getBasicOCSPResp()
      Returns the BasicOCSPResp
      Returns:
      BasicOCSPResp
    • getLatestSingleResp

      public org.bouncycastle.cert.ocsp.SingleResp getLatestSingleResp()
      Returns the latest single response
      Returns:
      SingleResp
    • getCertificateSource

      public OCSPCertificateSource getCertificateSource()
      Description copied from class: RevocationToken
      Returns a source of embedded into a revocation token certificates
      Specified by:
      getCertificateSource in class RevocationToken<OCSP>
      Returns:
      RevocationCertificateSource
    • getEncoded

      public byte[] getEncoded()
      Specified by:
      getEncoded in class Token
    • getIssuerX500Principal

      public X500Principal getIssuerX500Principal()
      Specified by:
      getIssuerX500Principal in class Token
    • getIssuerCertificateToken

      public CertificateToken getIssuerCertificateToken()
      Description copied from class: RevocationToken
      Returns issuer CertificateToken
      Specified by:
      getIssuerCertificateToken in class RevocationToken<OCSP>
      Returns:
      issuer CertificateToken
    • isValid

      public boolean isValid()
      Indicates if the OCSP token is valid. NOTE: The method isSignedBy(token) must be called before!
      Overrides:
      isValid in class Token
      Returns:
      whether the OCSP token is valid
    • checkIsSignedBy

      protected eu.europa.esig.dss.enumerations.SignatureValidity checkIsSignedBy(PublicKey publicKey)
      Verifies if the current OCSP token has been signed by the specified publicKey
      Specified by:
      checkIsSignedBy in class Token
      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

      public eu.europa.esig.dss.enumerations.RevocationType getRevocationType()
      Description copied from class: RevocationToken
      Returns the Revocation Token type (CRL or OCSP)
      Specified by:
      getRevocationType in class RevocationToken<OCSP>
      Returns:
      RevocationType of the token
    • getAbbreviation

      public String getAbbreviation()
      Overrides:
      getAbbreviation in class Token
    • toString

      public String toString(String indentStr)
      Specified by:
      toString in class Token