Class OpenSamlCredential
java.lang.Object
org.opensaml.security.credential.AbstractCredential
org.opensaml.security.credential.BasicCredential
org.opensaml.security.x509.BasicX509Credential
se.swedenconnect.security.credential.opensaml.OpenSamlCredential
- All Implemented Interfaces:
org.opensaml.security.credential.Credential
,org.opensaml.security.credential.MutableCredential
,org.opensaml.security.x509.X509Credential
public class OpenSamlCredential
extends org.opensaml.security.x509.BasicX509Credential
A credential that implements OpenSAML's
X509Credential
interface and wraps a
PkiCredential
. This enables us to make use of features such as testing and re-loading (see
ReloadablePkiCredential
), but most importantly, it gives use a smooth way of instantiating OpenSAML
credentials.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Constructor Summary
ConstructorDescriptionOpenSamlCredential
(X509Certificate entityCertificate, PrivateKey privateKey) Constructor setting up the credential by explicitly assigning the certificate and private key.OpenSamlCredential
(PkiCredential credential) Constructor setting up the OpenSAML credential by assigning aPkiCredential
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setEntityCertificate
(X509Certificate entityCertificate) void
setEntityCertificateChain
(Collection<X509Certificate> certificateChain) void
setPrivateKey
(PrivateKey privateKey) Methods inherited from class org.opensaml.security.x509.BasicX509Credential
getCredentialType, getCRLs, getSecretKey, setCRLs, setPublicKey, setSecretKey
Methods inherited from class org.opensaml.security.credential.BasicCredential
setEntityId, setUsageType
Methods inherited from class org.opensaml.security.credential.AbstractCredential
getCredentialContextSet, getEntityId, getKeyNames, getUsageType
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, getUsageType
-
Constructor Details
-
OpenSamlCredential
Constructor setting up the credential by explicitly assigning the certificate and private key.- Parameters:
entityCertificate
- the certificateprivateKey
- the private key
-
OpenSamlCredential
Constructor setting up the OpenSAML credential by assigning aPkiCredential
instance. This type of setting up theOpenSamlCredential
is recommended since it gives the benefits of monitoring (and reloading) credentials as well as a simple way to use hardware based keys (e.g.Pkcs11Credential
).- Parameters:
credential
- the credential to wrap in a OpenSAML credential
-
-
Method Details
-
getPublicKey
- Specified by:
getPublicKey
in interfaceorg.opensaml.security.credential.Credential
- Overrides:
getPublicKey
in classorg.opensaml.security.x509.BasicX509Credential
-
getPrivateKey
- Specified by:
getPrivateKey
in interfaceorg.opensaml.security.credential.Credential
- Overrides:
getPrivateKey
in classorg.opensaml.security.credential.AbstractCredential
-
setPrivateKey
- Specified by:
setPrivateKey
in interfaceorg.opensaml.security.credential.MutableCredential
- Overrides:
setPrivateKey
in classorg.opensaml.security.credential.BasicCredential
-
getEntityCertificate
- Specified by:
getEntityCertificate
in interfaceorg.opensaml.security.x509.X509Credential
- Overrides:
getEntityCertificate
in classorg.opensaml.security.x509.BasicX509Credential
-
setEntityCertificate
- Overrides:
setEntityCertificate
in classorg.opensaml.security.x509.BasicX509Credential
-
getEntityCertificateChain
- Specified by:
getEntityCertificateChain
in interfaceorg.opensaml.security.x509.X509Credential
- Overrides:
getEntityCertificateChain
in classorg.opensaml.security.x509.BasicX509Credential
-
setEntityCertificateChain
- Overrides:
setEntityCertificateChain
in classorg.opensaml.security.x509.BasicX509Credential
-