Package org.opensaml.security.credential
Interface Credential
- All Known Subinterfaces:
KeyAgreementCredential
,MutableCredential
,X509Credential
- All Known Implementing Classes:
AbstractCredential
,BasicCredential
,BasicKeyAgreementCredential
,BasicX509Credential
,KeyStoreX509CredentialAdapter
,ServletRequestX509CredentialAdapter
,X509KeyManagerX509CredentialAdapter
public interface Credential
A credential for an entity. A particular credential may contain either asymmetric key information (a public key
and optionally the corresponding private key), or a symmetric (secret) key, but never both.
With asymmetric key-based credentials, local entity credentials will usually contain both a public
and private key while peer credentials will normally contain only a public key.
-
Method Summary
Modifier and TypeMethodDescriptionGet the set of credential context information, which provides additional information specific to the contexts in which the credential was resolved.Class<? extends Credential>
Get the primary type of the credential instance.The unique ID of the entity this credential is for.Gets key names for this credential.Gets the private key for the entity if there is one.Gets the public key for the entity.Gets the secret key for this entity.Gets usage type of this credential.
-
Method Details
-
getEntityId
The unique ID of the entity this credential is for.- Returns:
- unique ID of the entity this credential is for
-
getUsageType
Gets usage type of this credential.- Returns:
- usage type of this credential
-
getKeyNames
Gets key names for this credential. These names may be used to reference a key(s) exchanged through an out-of-band agreement. Implementations may or may not implement means to resolve these names into keys retrievable through thegetPublicKey()
,getPrivateKey()
orgetSecretKey()
methods.- Returns:
- key names for this credential
-
getPublicKey
Gets the public key for the entity.- Returns:
- public key for the entity
-
getPrivateKey
Gets the private key for the entity if there is one.- Returns:
- the private key for the entity
-
getSecretKey
Gets the secret key for this entity.- Returns:
- secret key for this entity
-
getCredentialContextSet
Get the set of credential context information, which provides additional information specific to the contexts in which the credential was resolved.- Returns:
- set of resolution contexts of the credential
-
getCredentialType
Get the primary type of the credential instance. This will usually be the primary sub-interface ofCredential
implemented by an implementation.- Returns:
- the credential type
-