Class RequestCertificate

java.lang.Object
org.simpleframework.http.core.RequestCertificate
All Implemented Interfaces:
Certificate

class RequestCertificate extends Object implements Certificate
The RequestCertificate represents a certificate for an HTTP request. It basically wraps the raw SSL certificate that comes with the Channel. Wrapping the raw certificate allows us to enforce the HTTPS workflow for SSL renegotiation, which requires some rather weird behaviour. Most importantly we only allow a challenge when the response has not been sent.
See Also:
  • Field Details

    • challenge

      private final CertificateChallenge challenge
      This is used to challenge the client for an X509 certificate.
    • certificate

      private final Certificate certificate
      This is the raw underlying certificate for the SSL channel.
    • channel

      private final Channel channel
      This is the channel representing the client connection.
  • Constructor Details

    • RequestCertificate

      public RequestCertificate(BodyObserver observer, Entity entity)
      Constructor for the RequestCertificate. This is used to create a wrapper for the raw SSL certificate that is provided by the underlying SSL session.
      Parameters:
      observer - the observer used to observe the transaction
      entity - the request entity containing the data
  • Method Details

    • getChain

      public X509Certificate[] getChain() throws Exception
      This will return the X509 certificate chain, if any, that has been sent by the client. A certificate chain is typically only send when the server explicitly requests the certificate on the initial connection or when it is challenged for.
      Specified by:
      getChain in interface Certificate
      Returns:
      this returns the clients X509 certificate chain
      Throws:
      Exception
    • getChallenge

      public CertificateChallenge getChallenge() throws Exception
      This returns a challenge for the certificate. A challenge is issued by providing a Runnable task which is to be executed when the challenge has completed. Typically this task should be used to drive completion of an HTTPS request.
      Specified by:
      getChallenge in interface Certificate
      Returns:
      this returns a challenge for the client certificate
      Throws:
      Exception
    • isChainPresent

      public boolean isChainPresent() throws Exception
      This is used to determine if the X509 certificate chain is present for the request. If it is not present then a challenge can be used to request the certificate.
      Specified by:
      isChainPresent in interface Certificate
      Returns:
      true if the certificate chain is present
      Throws:
      Exception