org.keycloak.services.x509

## Class AbstractClientCertificateFromHttpHeadersLookup

- java.lang.Object
- - org.keycloak.services.x509.AbstractClientCertificateFromHttpHeadersLookup

- All Implemented Interfaces:
    Provider, X509ClientCertificateLookup
  Direct Known Subclasses:
    ApacheProxySslClientCertificateLookup, HaProxySslClientCertificateLookup, NginxProxySslClientCertificateLookup

      public abstract class AbstractClientCertificateFromHttpHeadersLookup
      extends Object
      implements X509ClientCertificateLookup

  Since:
    3/29/2017
  Version:
    $Revision: 1 $
  Author:
    Peter Nalyvayko

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `certificateChainLength`
    `protected static org.jboss.logging.Logger` | `logger`
    `protected String` | `sslCertChainHttpHeaderPrefix`
    `protected String` | `sslClientCertHttpHeader`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractClientCertificateFromHttpHeadersLookup(String sslCientCertHttpHeader, String sslCertChainHttpHeaderPrefix, int certificateChainLength)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `protected abstract X509Certificate` | `decodeCertificateFromPem(String pem)`
    `X509Certificate[]` | `getCertificateChain(org.jboss.resteasy.spi.HttpRequest httpRequest)` Returns a client certificate, and optionally any certificates in the certificate chain.
    `protected X509Certificate` | `getCertificateFromHttpHeader(org.jboss.resteasy.spi.HttpRequest request, String httpHeader)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

    - #### sslClientCertHttpHeader

          protected final String sslClientCertHttpHeader

    - #### sslCertChainHttpHeaderPrefix

          protected final String sslCertChainHttpHeaderPrefix

    - #### certificateChainLength

          protected final int certificateChainLength

  - ### Constructor Detail

    - #### AbstractClientCertificateFromHttpHeadersLookup

          public AbstractClientCertificateFromHttpHeadersLookup(String sslCientCertHttpHeader,
                                                                String sslCertChainHttpHeaderPrefix,
                                                                int certificateChainLength)

  - ### Method Detail

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

    - #### decodeCertificateFromPem

          protected abstract X509Certificate decodeCertificateFromPem(String pem)
                                                               throws PemException

      Throws:
        `PemException`

    - #### getCertificateFromHttpHeader

          protected X509Certificate getCertificateFromHttpHeader(org.jboss.resteasy.spi.HttpRequest request,
                                                                 String httpHeader)
                                                          throws GeneralSecurityException

      Throws:
        `GeneralSecurityException`

    - #### getCertificateChain

          public X509Certificate[] getCertificateChain(org.jboss.resteasy.spi.HttpRequest httpRequest)
                                                throws GeneralSecurityException

      Description copied from interface: `X509ClientCertificateLookup`
      Returns a client certificate, and optionally any certificates in the certificate chain.
      Specified by:
        `getCertificateChain` in interface `X509ClientCertificateLookup`
      Returns:
      Throws:
        `GeneralSecurityException`

Copyright © 2021 JBoss by Red Hat. All rights reserved.