Package org.opensaml.security.x509.impl
Class KeyStoreX509CredentialAdapter
- java.lang.Object
-
- org.opensaml.security.credential.AbstractCredential
-
- org.opensaml.security.x509.impl.KeyStoreX509CredentialAdapter
-
- All Implemented Interfaces:
Credential,X509Credential
public class KeyStoreX509CredentialAdapter extends AbstractCredential implements X509Credential
A wrapper that changes aKeyStorein to aX509Credential.
-
-
Field Summary
Fields Modifier and Type Field Description private StringcredentialAliasAlias to the credential to be exposed.private char[]keyPasswordPassword for the key to be exposed.private KeyStorekeyStoreKeystore that contains the credential to be exposed.private org.slf4j.LoggerlogClass logger.
-
Constructor Summary
Constructors Constructor Description KeyStoreX509CredentialAdapter(KeyStore store, String alias, char[] password)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<? extends Credential>getCredentialType()Collection<X509CRL>getCRLs()X509CertificategetEntityCertificate()Collection<X509Certificate>getEntityCertificateChain()PrivateKeygetPrivateKey()PublicKeygetPublicKey()voidsetEntityId(String newEntityID)voidsetUsageType(UsageType newUsageType)-
Methods inherited from class org.opensaml.security.credential.AbstractCredential
getCredentialContextSet, getEntityId, getKeyNames, getSecretKey, getUsageType, setPrivateKey, setPublicKey, setSecretKey
-
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, getSecretKey, getUsageType
-
-
-
-
Field Detail
-
log
private org.slf4j.Logger log
Class logger.
-
keyStore
private final KeyStore keyStore
Keystore that contains the credential to be exposed.
-
credentialAlias
private final String credentialAlias
Alias to the credential to be exposed.
-
keyPassword
private final char[] keyPassword
Password for the key to be exposed.
-
-
Constructor Detail
-
KeyStoreX509CredentialAdapter
public KeyStoreX509CredentialAdapter(@Nonnull @ParameterName(name="store") KeyStore store, @Nonnull @ParameterName(name="alias") String alias, @Nullable @ParameterName(name="password") char[] password)
Constructor.- Parameters:
store- store containing key to be exposedalias- alias to the credential to be exposedpassword- password to the key to be exposed
-
-
Method Detail
-
getCRLs
@Nullable public Collection<X509CRL> getCRLs()
- Specified by:
getCRLsin interfaceX509Credential
-
getEntityCertificate
@Nonnull public X509Certificate getEntityCertificate()
- Specified by:
getEntityCertificatein interfaceX509Credential
-
getEntityCertificateChain
@Nonnull public Collection<X509Certificate> getEntityCertificateChain()
- Specified by:
getEntityCertificateChainin interfaceX509Credential
-
getPrivateKey
@Nullable public PrivateKey getPrivateKey()
- Specified by:
getPrivateKeyin interfaceCredential- Overrides:
getPrivateKeyin classAbstractCredential
-
getPublicKey
@Nullable public PublicKey getPublicKey()
- Specified by:
getPublicKeyin interfaceCredential- Overrides:
getPublicKeyin classAbstractCredential
-
getCredentialType
@Nonnull public Class<? extends Credential> getCredentialType()
- Specified by:
getCredentialTypein interfaceCredential
-
setEntityId
public void setEntityId(@Nullable String newEntityID)- Overrides:
setEntityIdin classAbstractCredential
-
setUsageType
public void setUsageType(@Nonnull UsageType newUsageType)- Overrides:
setUsageTypein classAbstractCredential
-
-