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
public class BasicCredential extends AbstractCredential implements MutableCredential
A basic implementation ofCredential.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBasicCredential()Constructor.BasicCredential(PublicKey publicKey)Constructor.BasicCredential(PublicKey publicKey, PrivateKey privateKey)Constructor.BasicCredential(SecretKey secretKey)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<? extends Credential>getCredentialType()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, 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 Detail
-
BasicCredential
public BasicCredential(@Nonnull PublicKey publicKey)Constructor.- Parameters:
publicKey- the credential public key
-
BasicCredential
public BasicCredential(@Nonnull PublicKey publicKey, @Nullable PrivateKey privateKey)Constructor.- Parameters:
publicKey- the credential public keyprivateKey- the credential private key
-
BasicCredential
public BasicCredential(@Nonnull SecretKey secretKey)Constructor.- Parameters:
secretKey- the credential secret key
-
BasicCredential
protected BasicCredential()
Constructor.
-
-
Method Detail
-
getCredentialType
public Class<? extends Credential> 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
public void setEntityId(@Nullable String newEntityId)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
public void setUsageType(@Nonnull UsageType newUsageType)Sets the usage type for this credential.- Specified by:
setUsageTypein interfaceMutableCredential- Overrides:
setUsageTypein classAbstractCredential- Parameters:
newUsageType- usage type for this credential
-
setPublicKey
public void setPublicKey(@Nonnull PublicKey newPublicKey)Sets the public key for this credential.- Specified by:
setPublicKeyin interfaceMutableCredential- Overrides:
setPublicKeyin classAbstractCredential- Parameters:
newPublicKey- public key for this credential
-
setPrivateKey
public void setPrivateKey(@Nonnull PrivateKey newPrivateKey)Sets the private key for this credential.- Specified by:
setPrivateKeyin interfaceMutableCredential- Overrides:
setPrivateKeyin classAbstractCredential- Parameters:
newPrivateKey- private key for this credential
-
setSecretKey
public void setSecretKey(@Nonnull SecretKey newSecretKey)Sets the secret key for this credential.- Specified by:
setSecretKeyin interfaceMutableCredential- Overrides:
setSecretKeyin classAbstractCredential- Parameters:
newSecretKey- secret key for this credential
-
-