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:
BasicKeyAgreementCredential
,BasicX509Credential
A basic implementation of
Credential
.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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.void
setEntityId
(String newEntityId) Sets the ID of the entity this credential is for.void
setPrivateKey
(PrivateKey newPrivateKey) Sets the private key for this credential.void
setPublicKey
(PublicKey newPublicKey) Sets the public key for this credential.void
setSecretKey
(SecretKey newSecretKey) Sets the secret key for this credential.void
setUsageType
(UsageType newUsageType) Sets the usage type for this credential.Methods inherited from class org.opensaml.security.credential.AbstractCredential
getCredentialContextSet, getEntityId, getKeyNames, getPrivateKey, getPublicKey, getSecretKey, getUsageType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensaml.security.credential.Credential
getCredentialContextSet, getEntityId, getKeyNames, getPrivateKey, getPublicKey, getSecretKey, getUsageType
-
Constructor Details
-
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
-
BasicCredential
protected BasicCredential()Constructor.
-
-
Method Details
-
getCredentialType
Get the primary type of the credential instance. This will usually be the primary sub-interface ofCredential
implemented by an implementation.- Specified by:
getCredentialType
in interfaceCredential
- Returns:
- the credential type
-
setEntityId
Sets the ID of the entity this credential is for.- Specified by:
setEntityId
in interfaceMutableCredential
- Overrides:
setEntityId
in classAbstractCredential
- Parameters:
newEntityId
- ID of the entity this credential is for
-
setUsageType
Sets the usage type for this credential.- Specified by:
setUsageType
in interfaceMutableCredential
- Overrides:
setUsageType
in classAbstractCredential
- Parameters:
newUsageType
- usage type for this credential
-
setPublicKey
Sets the public key for this credential.- Specified by:
setPublicKey
in interfaceMutableCredential
- Overrides:
setPublicKey
in classAbstractCredential
- Parameters:
newPublicKey
- public key for this credential
-
setPrivateKey
Sets the private key for this credential.- Specified by:
setPrivateKey
in interfaceMutableCredential
- Overrides:
setPrivateKey
in classAbstractCredential
- Parameters:
newPrivateKey
- private key for this credential
-
setSecretKey
Sets the secret key for this credential.- Specified by:
setSecretKey
in interfaceMutableCredential
- Overrides:
setSecretKey
in classAbstractCredential
- Parameters:
newSecretKey
- secret key for this credential
-