Package org.opensaml.security.messaging
Class ServletRequestX509CredentialAdapter
java.lang.Object
org.opensaml.security.credential.AbstractCredential
org.opensaml.security.messaging.ServletRequestX509CredentialAdapter
- All Implemented Interfaces:
Credential
,X509Credential
public class ServletRequestX509CredentialAdapter
extends AbstractCredential
implements X509Credential
An adapter that exposes the X.509 certificates contained in the servlet request attribute.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate X509Certificate
The entity certificate.private List<X509Certificate>
The certificate chain.static final String
Servlet request attribute to pull certificate info from.static final String
Servlet request attribute to pull certificate info from. -
Constructor Summary
ConstructorsConstructorDescriptionServletRequestX509CredentialAdapter
(javax.servlet.ServletRequest request) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Credential>
Get the primary type of the credential instance.getCRLs()
Gets a collection of CRLs associated with the credential.Gets the public key certificate for the entity.Gets an immutable collection of certificates in the entity's trust chain.Gets the public key for the entity.Methods inherited from class org.opensaml.security.credential.AbstractCredential
getCredentialContextSet, getEntityId, getKeyNames, getPrivateKey, getSecretKey, getUsageType, setEntityId, setPrivateKey, setPublicKey, setSecretKey, setUsageType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensaml.security.credential.Credential
getCredentialContextSet, getEntityId, getKeyNames, getPrivateKey, getSecretKey, getUsageType
-
Field Details
-
X509_CERT_REQUEST_ATTRIBUTE
Servlet request attribute to pull certificate info from.- See Also:
-
JAKARTA_X509_CERT_REQUEST_ATTRIBUTE
Servlet request attribute to pull certificate info from.- See Also:
-
cert
The entity certificate. -
certChain
The certificate chain.
-
-
Constructor Details
-
ServletRequestX509CredentialAdapter
public ServletRequestX509CredentialAdapter(javax.servlet.ServletRequest request) throws SecurityException Constructor.- Parameters:
request
- the servlet request- Throws:
SecurityException
- if request does not contain an X.509 client certificate in request attribute 'javax.servlet.request.X509Certificate'
-
-
Method Details
-
getCredentialType
Get the primary type of the credential instance. This will usually be the primary sub-interface ofCredential
implemented by an implementation.- Specified by:
getCredentialType
in interfaceCredential
- Returns:
- the credential type
-
getEntityCertificate
Gets the public key certificate for the entity. The public key of this certificate will be the same key obtained fromCredential.getPublicKey()
.- Specified by:
getEntityCertificate
in interfaceX509Credential
- Returns:
- the public key certificate for the entity
-
getEntityCertificateChain
Gets an immutable collection of certificates in the entity's trust chain. The entity certificate is contained within this list. No specific ordering of the certificates is guaranteed.- Specified by:
getEntityCertificateChain
in interfaceX509Credential
- Returns:
- entities certificate chain
-
getCRLs
Gets a collection of CRLs associated with the credential.- Specified by:
getCRLs
in interfaceX509Credential
- Returns:
- CRLs associated with the credential
-
getPublicKey
Gets the public key for the entity.- Specified by:
getPublicKey
in interfaceCredential
- Overrides:
getPublicKey
in classAbstractCredential
- Returns:
- public key for the entity
-