Package org.opensaml.security.credential
Class AbstractCredential
java.lang.Object
org.opensaml.security.credential.AbstractCredential
- All Implemented Interfaces:
Credential
- Direct Known Subclasses:
BasicCredential,KeyStoreX509CredentialAdapter,ServletRequestX509CredentialAdapter,X509KeyManagerX509CredentialAdapter
Base class for
Credential implementations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CredentialContextSetCredential context of this credential.private StringID of the entity owning this credential.private Collection<String>Key names for this credential.private PrivateKeyPrivate key of this credential.private PublicKeyPublic key of this credential.private SecretKeySecret key for this credential.private UsageTypeUsage type of this credential. -
Constructor Summary
Constructors -
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.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.protected voidsetEntityId(String newEntityID) Sets the ID of the entity this credential is for.protected voidsetPrivateKey(PrivateKey newPrivateKey) Sets the private key for this credential.protected voidsetPublicKey(PublicKey newPublicKey) Sets the public key for this credential.protected voidsetSecretKey(SecretKey newSecretKey) Sets the secret key for this credential.protected voidsetUsageType(UsageType newUsageType) Sets the usage type for this credential.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensaml.security.credential.Credential
getCredentialType
-
Field Details
-
entityId
ID of the entity owning this credential. -
usageType
Usage type of this credential. -
keyNames
Key names for this credential. -
publicKey
Public key of this credential. -
secretKey
Secret key for this credential. -
privateKey
Private key of this credential. -
credentialContextSet
Credential context of this credential.
-
-
Constructor Details
-
AbstractCredential
public AbstractCredential()Constructor.
-
-
Method Details
-
getEntityId
The unique ID of the entity this credential is for.- Specified by:
getEntityIdin interfaceCredential- Returns:
- unique ID of the entity this credential is for
-
getUsageType
Gets usage type of this credential.- Specified by:
getUsageTypein interfaceCredential- 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 theCredential.getPublicKey(),Credential.getPrivateKey()orCredential.getSecretKey()methods.- Specified by:
getKeyNamesin interfaceCredential- Returns:
- key names for this credential
-
getPublicKey
Gets the public key for the entity.- Specified by:
getPublicKeyin interfaceCredential- Returns:
- public key for the entity
-
getSecretKey
Gets the secret key for this entity.- Specified by:
getSecretKeyin interfaceCredential- Returns:
- secret key for this entity
-
getPrivateKey
Gets the private key for the entity if there is one.- Specified by:
getPrivateKeyin interfaceCredential- Returns:
- the private key for the entity
-
getCredentialContextSet
Get the set of credential context information, which provides additional information specific to the contexts in which the credential was resolved.- Specified by:
getCredentialContextSetin interfaceCredential- Returns:
- set of resolution contexts of the credential
-
setEntityId
Sets the ID of the entity this credential is for.- Parameters:
newEntityID- ID of the entity this credential is for
-
setUsageType
Sets the usage type for this credential.- Parameters:
newUsageType- usage type for this credential
-
setPublicKey
Sets the public key for this credential.- Parameters:
newPublicKey- public key for this credential
-
setPrivateKey
Sets the private key for this credential.- Parameters:
newPrivateKey- private key for this credential
-
setSecretKey
Sets the secret key for this credential.- Parameters:
newSecretKey- secret key for this credential
-