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
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
If the credentialname
property 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 PublicKey
If a credential without a certificate is created, this method must be overridden and return the installedPublicKey
.void
Assigns the credential name.protected void
Updates 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, wait
Methods 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:
getPublicKey
in 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
null
if 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:
getName
in interfacePkiCredential
- Returns:
- the name
-
setName
Assigns the credential name.- Parameters:
name
- the name
-
getDefaultName
If the credentialname
property 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:
getMetadata
in 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.
-