Package 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,NginxProxyTrustedClientCertificateLookup
public abstract class AbstractClientCertificateFromHttpHeadersLookup
extends Object
implements X509ClientCertificateLookup
- Since:
- 3/29/2017
- Version:
- $Revision: 1 $
- Author:
- Peter Nalyvayko
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractClientCertificateFromHttpHeadersLookup(String sslCientCertHttpHeader, String sslCertChainHttpHeaderPrefix, int certificateChainLength) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildChain(HttpRequest httpRequest, List<X509Certificate> chain, X509Certificate cert) voidclose()protected abstract X509Certificatefinal X509Certificate[]getCertificateChain(HttpRequest httpRequest) Returns a client certificate, and optionally any certificates in the certificate chain.protected X509CertificategetCertificateFromHttpHeader(HttpRequest request, String httpHeader)
-
Field Details
-
logger
protected static final org.jboss.logging.Logger logger -
sslClientCertHttpHeader
-
sslCertChainHttpHeaderPrefix
-
certificateChainLength
protected final int certificateChainLength
-
-
Constructor Details
-
AbstractClientCertificateFromHttpHeadersLookup
-
-
Method Details
-
close
public void close() -
decodeCertificateFromPem
- Throws:
PemException
-
getCertificateFromHttpHeader
protected X509Certificate getCertificateFromHttpHeader(HttpRequest request, String httpHeader) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
getCertificateChain
public final X509Certificate[] getCertificateChain(HttpRequest httpRequest) throws GeneralSecurityException Description copied from interface:X509ClientCertificateLookupReturns a client certificate, and optionally any certificates in the certificate chain.- Specified by:
getCertificateChainin interfaceX509ClientCertificateLookup- Returns:
- Throws:
GeneralSecurityException
-
buildChain
protected void buildChain(HttpRequest httpRequest, List<X509Certificate> chain, X509Certificate cert)
-