public class JKSKeyManager extends Object implements KeyManager
Constructor and Description |
---|
JKSKeyManager(KeyStore keyStore,
Map<String,String> passwords,
String defaultKey)
Default constructor which uses an existing KeyStore instance for loading of credentials.
|
JKSKeyManager(org.springframework.core.io.Resource storeFile,
String storePass,
Map<String,String> passwords,
String defaultKey)
Default constructor which instantiates a new KeyStore used to load all credentials.
|
Modifier and Type | Method and Description |
---|---|
Set<String> |
getAvailableCredentials()
Method provides list of all credentials available in the storage.
|
X509Certificate |
getCertificate(String alias)
Returns certificate with the given alias from the keystore.
|
org.opensaml.xml.security.credential.Credential |
getCredential(String keyName)
Returns Credential object used to sign the messages issued by this entity.
|
org.opensaml.xml.security.credential.Credential |
getDefaultCredential()
Returns Credential object used to sign the messages issued by this entity.
|
String |
getDefaultCredentialName()
Method provides name of the credential which should be used by default when no other is specified.
|
KeyStore |
getKeyStore() |
PublicKey |
getPublicKey(String alias)
Returns public key with the given alias
|
Iterable<org.opensaml.xml.security.credential.Credential> |
resolve(org.opensaml.xml.security.CriteriaSet criteriaSet) |
org.opensaml.xml.security.credential.Credential |
resolveSingle(org.opensaml.xml.security.CriteriaSet criteriaSet) |
public JKSKeyManager(KeyStore keyStore, Map<String,String> passwords, String defaultKey)
keyStore
- key store to usepasswords
- passwords used to access private keysdefaultKey
- default keypublic JKSKeyManager(org.springframework.core.io.Resource storeFile, String storePass, Map<String,String> passwords, String defaultKey)
storeFile
- file pointing to the JKS keystorestorePass
- password to access the keystore, or null for no passwordpasswords
- passwords used to access private keysdefaultKey
- default keypublic X509Certificate getCertificate(String alias)
getCertificate
in interface KeyManager
alias
- alias of certificate to findpublic PublicKey getPublicKey(String alias)
alias
- alias of the key to findpublic Iterable<org.opensaml.xml.security.credential.Credential> resolve(org.opensaml.xml.security.CriteriaSet criteriaSet) throws org.opensaml.xml.security.SecurityException
resolve
in interface org.opensaml.xml.security.Resolver<org.opensaml.xml.security.credential.Credential,org.opensaml.xml.security.CriteriaSet>
org.opensaml.xml.security.SecurityException
public org.opensaml.xml.security.credential.Credential resolveSingle(org.opensaml.xml.security.CriteriaSet criteriaSet) throws org.opensaml.xml.security.SecurityException
resolveSingle
in interface org.opensaml.xml.security.Resolver<org.opensaml.xml.security.credential.Credential,org.opensaml.xml.security.CriteriaSet>
org.opensaml.xml.security.SecurityException
public org.opensaml.xml.security.credential.Credential getCredential(String keyName)
getCredential
in interface KeyManager
keyName
- name of the key to use, in case of null default key is usedpublic org.opensaml.xml.security.credential.Credential getDefaultCredential()
getDefaultCredential
in interface KeyManager
public String getDefaultCredentialName()
KeyManager
getDefaultCredentialName
in interface KeyManager
public Set<String> getAvailableCredentials()
KeyManager
getAvailableCredentials
in interface KeyManager
public KeyStore getKeyStore()