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 SignatureAlgorithm getSignatureAlgorithm()
      Description copied from class: Token
      Returns the algorithm that was used to sign the token (ex: SHA1WithRSAEncryption, SHA1withRSA...).
      Overrides:
      getSignatureAlgorithm in class Token
      Returns:
      the used signature algorithm to sign this 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()
      Description copied from class: Token
      Returns the encoded form of the wrapped token.
      Specified by:
      getEncoded in class Token
      Returns:
      the encoded form of the wrapped token
    • getIssuerX500Principal

      public X500Principal getIssuerX500Principal()
      Description copied from class: Token
      Returns the X500Principal of the certificate which was used to sign this token.
      Specified by:
      getIssuerX500Principal in class Token
      Returns:
      the issuer's X500Principal
    • 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 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 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()
      Description copied from class: Token
      This method returns the DSS abbreviation of the token. It is used for debugging purpose.
      Overrides:
      getAbbreviation in class Token
      Returns:
      an abbreviation for the certificate
    • toString

      public String toString(String indentStr)
      Description copied from class: Token
      Returns a string representation of the token.
      Specified by:
      toString in class Token
      Parameters:
      indentStr - the indentation to use
      Returns:
      string representation of the token