Package org.opensaml.security.credential
Class BasicCredential
java.lang.Object
org.opensaml.security.credential.AbstractCredential
org.opensaml.security.credential.BasicCredential
- All Implemented Interfaces:
Credential,MutableCredential
- Direct Known Subclasses:
BasicX509Credential
A basic implementation of
Credential.-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.BasicCredential(PublicKey publicKey) Constructor.BasicCredential(PublicKey publicKey, PrivateKey privateKey) Constructor.BasicCredential(SecretKey secretKey) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Credential>Get the primary type of the credential instance.voidsetEntityId(String newEntityId) Sets the ID of the entity this credential is for.voidsetPrivateKey(PrivateKey newPrivateKey) Sets the private key for this credential.voidsetPublicKey(PublicKey newPublicKey) Sets the public key for this credential.voidsetSecretKey(SecretKey newSecretKey) Sets the secret key for this credential.voidsetUsageType(UsageType newUsageType) Sets the usage type for this credential.Methods inherited from class org.opensaml.security.credential.AbstractCredential
getCredentialContextSet, getEntityId, getKeyNames, getPrivateKey, getPublicKey, getSecretKey, getUsageTypeMethods 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
getCredentialContextSet, getEntityId, getKeyNames, getPrivateKey, getPublicKey, getSecretKey, getUsageType
-
Constructor Details
-
BasicCredential
public BasicCredential()Default constructor. -
BasicCredential
Constructor.- Parameters:
publicKey- the credential public key
-
BasicCredential
Constructor.- Parameters:
publicKey- the credential public keyprivateKey- the credential private key
-
BasicCredential
Constructor.- Parameters:
secretKey- the credential secret key
-
-
Method Details
-
getCredentialType
Get the primary type of the credential instance. This will usually be the primary sub-interface ofCredentialimplemented by an implementation.- Specified by:
getCredentialTypein interfaceCredential- Returns:
- the credential type
-
setEntityId
Sets the ID of the entity this credential is for.- Specified by:
setEntityIdin interfaceMutableCredential- Overrides:
setEntityIdin classAbstractCredential- Parameters:
newEntityId- ID of the entity this credential is for
-
setUsageType
Sets the usage type for this credential.- Specified by:
setUsageTypein interfaceMutableCredential- Overrides:
setUsageTypein classAbstractCredential- Parameters:
newUsageType- usage type for this credential
-
setPublicKey
Sets the public key for this credential.- Specified by:
setPublicKeyin interfaceMutableCredential- Overrides:
setPublicKeyin classAbstractCredential- Parameters:
newPublicKey- public key for this credential
-
setPrivateKey
Sets the private key for this credential.- Specified by:
setPrivateKeyin interfaceMutableCredential- Overrides:
setPrivateKeyin classAbstractCredential- Parameters:
newPrivateKey- private key for this credential
-
setSecretKey
Sets the secret key for this credential.- Specified by:
setSecretKeyin interfaceMutableCredential- Overrides:
setSecretKeyin classAbstractCredential- Parameters:
newSecretKey- secret key for this credential
-