Class AbstractPkiCredential
java.lang.Object
se.swedenconnect.security.credential.AbstractPkiCredential
- All Implemented Interfaces:
PkiCredential
- Direct Known Subclasses:
AbstractReloadablePkiCredential,BasicCredential
Abstract base class for classes implementing the
PkiCredential interface.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Nested Class Summary
Nested classes/interfaces inherited from interface se.swedenconnect.security.credential.PkiCredential
PkiCredential.Metadata -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringIf the credentialnameproperty is not explicitly assigned usingsetName(String)a name is calculated based on a credential's properties.Gets the credential metadata.getName()Gets the name of the credential.Gets the public key.protected PublicKeyIf a credential without a certificate is created, this method must be overridden and return the installedPublicKey.voidAssigns the credential name.protected voidUpdates the metadata properties issued-at and expires-at based on the entity certificate of the credential.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface se.swedenconnect.security.credential.PkiCredential
destroy, getCertificate, getCertificateChain, getPrivateKey, isHardwareCredential, transform
-
Constructor Details
-
AbstractPkiCredential
public AbstractPkiCredential()Default constructor.
-
-
Method Details
-
getPublicKey
Gets the public key.- Specified by:
getPublicKeyin interfacePkiCredential- Returns:
- the public key
-
getStandalonePublicKey
If a credential without a certificate is created, this method must be overridden and return the installedPublicKey.- Returns:
- the standalone public key, or
nullif a certificate is present
-
getName
Gets the name of the credential. If no name has been explicitly assigned, the default name is used.- Specified by:
getNamein interfacePkiCredential- Returns:
- the name
-
setName
Assigns the credential name.- Parameters:
name- the name
-
getDefaultName
If the credentialnameproperty is not explicitly assigned usingsetName(String)a name is calculated based on a credential's properties.- Returns:
- the credential name
-
getMetadata
Gets the credential metadata.- Specified by:
getMetadatain interfacePkiCredential- Returns:
- a (potentially empty) credential metadata object
-
updateMetadataValidityProperties
protected void updateMetadataValidityProperties()Updates the metadata properties issued-at and expires-at based on the entity certificate of the credential.
-