Interface ClientCertificate

All Superinterfaces:
Certificate

public interface ClientCertificate extends Certificate
A client SSL certificate.
  • Method Details

    • of

      Returns the ClientCertificate instance for the given certificate and SSL private key.
      Parameters:
      x509Cert - an X.509 certificate
      privateKey - an SSL (EC or RSA) private key
      Throws:
      CertificateEncodingException - when certificate encoding fails
    • of

      static ClientCertificate of(X509Certificate x509Cert, SslPrivateKey privateKey, List<X509Certificate> intermediateX509Certs) throws CertificateEncodingException
      Returns the ClientCertificate instance for the given certificate, SSL private key, and intermediate certificates.
      Parameters:
      x509Cert - an X.509 certificate
      privateKey - an SSL (EC or RSA) private key
      intermediateX509Certs - a list of intermediate certificates for chain building. Can be empty.
      Throws:
      CertificateEncodingException - when certificate encoding fails
      Since:
      7.24.5
    • of

      static ClientCertificate of(Path keystoreFilePath, String keystorePassword, KeyStoreType keyStoreType)
      Loads a client certificate from the given keystore file with the given password and keystore type. The first (end-entity) certificate, all intermediate certificates, and private key will be taken from the given keystore.
      Parameters:
      keystoreFilePath - the path to a valid keystore file
      keystorePassword - the password used to access the keystore
      keyStoreType - the keystore type
      Throws:
      LoadClientCertificateException - when the client certificate loading has been failed
    • derEncodedValue

      default byte[] derEncodedValue()
      Returns an array of bytes that represents the DER-encoded representation of X509Certificate.
      Specified by:
      derEncodedValue in interface Certificate
    • intermediateCertificates

      default List<Certificate> intermediateCertificates()
      Returns the list of intermediate certificates associated with this certificate needed for chain building.
      Specified by:
      intermediateCertificates in interface Certificate
      Since:
      7.24.5
    • privateKey

      default SslPrivateKey privateKey()
      Returns the SSL private key of this client certificate.