|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensaml.xml.security.credential.AbstractCredentialResolver org.opensaml.xml.security.credential.AbstractCriteriaFilteringCredentialResolver org.opensaml.xml.security.credential.KeyStoreCredentialResolver
public class KeyStoreCredentialResolver
A CredentialResolver
that extracts Credential
's from a key store.
If no key usage type is presented at construction time this resolver will return the key, if available, regardless of
the usage type provided to its resolve method.
Constructor Summary | |
---|---|
KeyStoreCredentialResolver(KeyStore store,
Map<String,String> passwords)
Constructor. |
|
KeyStoreCredentialResolver(KeyStore store,
Map<String,String> passwords,
UsageType usage)
Constructor. |
Method Summary | |
---|---|
protected Credential |
buildCredential(KeyStore.Entry keyStoreEntry,
String entityID,
UsageType usage)
Build a credential instance from the key store entry. |
protected void |
checkCriteriaRequirements(CriteriaSet criteriaSet)
Check that required credential criteria are available. |
protected boolean |
matchUsage(UsageType keyStoreUsage,
UsageType criteriaUsage)
Match usage enum type values from keystore configured usage and from credential criteria. |
protected X509Credential |
processPrivateKeyEntry(KeyStore.PrivateKeyEntry privateKeyEntry,
String entityID,
UsageType usage)
Build an X509Credential from a keystore private key entry. |
protected Credential |
processSecretKeyEntry(KeyStore.SecretKeyEntry secretKeyEntry,
String entityID,
UsageType usage)
Build a Credential from a keystore secret key entry. |
protected X509Credential |
processTrustedCertificateEntry(KeyStore.TrustedCertificateEntry trustedCertEntry,
String entityID,
UsageType usage)
Build an X509Credential from a keystore trusted certificate entry. |
protected Iterable<Credential> |
resolveFromSource(CriteriaSet criteriaSet)
Subclasses are required to implement this method to resolve credentials from the implementation-specific type of underlying credential source. |
Methods inherited from class org.opensaml.xml.security.credential.AbstractCriteriaFilteringCredentialResolver |
---|
isMeetAllCriteria, isUnevaluableSatisfies, resolve, setMeetAllCriteria, setUnevaluableSatisfies |
Methods inherited from class org.opensaml.xml.security.credential.AbstractCredentialResolver |
---|
resolveSingle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KeyStoreCredentialResolver(KeyStore store, Map<String,String> passwords) throws IllegalArgumentException
store
- key store credentials are retrieved frompasswords
- for key entries, map key is the entity id, map value is the password
IllegalArgumentException
- thrown if the given keystore is nullpublic KeyStoreCredentialResolver(KeyStore store, Map<String,String> passwords, UsageType usage) throws IllegalArgumentException
store
- key store credentials are retrieved frompasswords
- for key entries, map key is the entity id, map value is the passwordusage
- usage type of all keys in the store
IllegalArgumentException
- thrown if the given keystore is nullMethod Detail |
---|
protected Iterable<Credential> resolveFromSource(CriteriaSet criteriaSet) throws SecurityException
resolveFromSource
in class AbstractCriteriaFilteringCredentialResolver
criteriaSet
- the set of criteria used to resolve credentials from the credential source
SecurityException
- thrown if there is an error resolving credentials from the credential sourceprotected void checkCriteriaRequirements(CriteriaSet criteriaSet)
criteriaSet
- the credential criteria set to evaluateprotected boolean matchUsage(UsageType keyStoreUsage, UsageType criteriaUsage)
keyStoreUsage
- the usage type configured for the keystorecriteriaUsage
- the value from credential criteria
protected Credential buildCredential(KeyStore.Entry keyStoreEntry, String entityID, UsageType usage) throws SecurityException
keyStoreEntry
- the key store entry to processentityID
- the entityID to include in the credentialusage
- the usage type to include in the credential
SecurityException
- throw if there is a problem building a credential from the key store entryprotected X509Credential processTrustedCertificateEntry(KeyStore.TrustedCertificateEntry trustedCertEntry, String entityID, UsageType usage)
trustedCertEntry
- the entry being processedentityID
- the entityID to setusage
- the usage type to set
protected X509Credential processPrivateKeyEntry(KeyStore.PrivateKeyEntry privateKeyEntry, String entityID, UsageType usage)
privateKeyEntry
- the entry being processedentityID
- the entityID to setusage
- the usage type to set
protected Credential processSecretKeyEntry(KeyStore.SecretKeyEntry secretKeyEntry, String entityID, UsageType usage)
secretKeyEntry
- the entry being processedentityID
- the entityID to setusage
- the usage type to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |