Package com.fortanix.sdkms.jce.provider
Class SdkmsKeyStore
- java.lang.Object
-
- java.security.KeyStoreSpi
-
- com.fortanix.sdkms.jce.provider.KeyStore
-
- com.fortanix.sdkms.jce.provider.SdkmsKeyStore
-
public final class SdkmsKeyStore extends KeyStore
-
-
Constructor Summary
Constructors Constructor Description SdkmsKeyStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Enumeration<String>
engineAliases()
Lists all the alias names of this keystore.boolean
engineContainsAlias(String alias)
void
engineDeleteEntry(String alias)
Deletes the entry from sdkmsString
engineGetCertificateAlias(Certificate cert)
Certificate[]
engineGetCertificateChain(String alias)
Throw an exception as we do not store certificate chain.Date
engineGetCreationDate(String alias)
Key
engineGetKey(String name, char[] password)
Returns the key associated with the given alias, using the given password to recover it.boolean
engineIsCertificateEntry(String alias)
boolean
engineIsKeyEntry(String alias)
void
engineLoad(InputStream stream, char[] password)
Loads the groupid from the given input stream.void
engineSetCertificateEntry(String alias, Certificate cert)
void
engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain)
int
engineSize()
throw exception as we do not get the size from sdkms.void
engineStore(OutputStream stream, char[] password)
No need to storing the keys as it is managed by sdkms.-
Methods inherited from class com.fortanix.sdkms.jce.provider.KeyStore
engineGetCertificate, engineSetKeyEntry, setCertificateEntry
-
Methods inherited from class java.security.KeyStoreSpi
engineEntryInstanceOf, engineGetEntry, engineLoad, engineProbe, engineSetEntry, engineStore
-
-
-
-
Method Detail
-
engineLoad
public void engineLoad(InputStream stream, char[] password) throws IOException
Loads the groupid from the given input stream.- Specified by:
engineLoad
in classKeyStore
- Parameters:
stream
- the input stream from which the groupid is loadedpassword
- the (optional) password- Throws:
IOException
- if there is an I/O or format problem with string
-
engineStore
public void engineStore(OutputStream stream, char[] password) throws IOException
No need to storing the keys as it is managed by sdkms.- Specified by:
engineStore
in classKeyStore
- Throws:
IOException
-
engineAliases
public Enumeration<String> engineAliases()
Lists all the alias names of this keystore.- Specified by:
engineAliases
in classKeyStore
- Returns:
- enumeration of the alias names
-
engineGetCertificateChain
public Certificate[] engineGetCertificateChain(String alias)
Throw an exception as we do not store certificate chain.- Specified by:
engineGetCertificateChain
in classKeyStore
-
engineGetCreationDate
public Date engineGetCreationDate(String alias)
- Specified by:
engineGetCreationDate
in classKeyStore
-
engineGetKey
public Key engineGetKey(String name, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException
Returns the key associated with the given alias, using the given password to recover it.- Specified by:
engineGetKey
in classKeyStore
- Parameters:
name
- the alias namepassword
- : always null- Returns:
- the requested key, or null if the given alias does not exist or does not identify a key entry.
- Throws:
NoSuchAlgorithmException
UnrecoverableKeyException
-
engineSetKeyEntry
public void engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) throws KeyStoreException
- Specified by:
engineSetKeyEntry
in classKeyStore
- Throws:
KeyStoreException
-
engineDeleteEntry
public void engineDeleteEntry(String alias) throws KeyStoreException
Deletes the entry from sdkms- Specified by:
engineDeleteEntry
in classKeyStore
- Throws:
KeyStoreException
-
engineContainsAlias
public boolean engineContainsAlias(String alias)
- Specified by:
engineContainsAlias
in classKeyStoreSpi
-
engineSize
public int engineSize()
throw exception as we do not get the size from sdkms.- Specified by:
engineSize
in classKeyStore
-
engineIsKeyEntry
public boolean engineIsKeyEntry(String alias)
- Specified by:
engineIsKeyEntry
in classKeyStore
-
engineIsCertificateEntry
public boolean engineIsCertificateEntry(String alias)
- Specified by:
engineIsCertificateEntry
in classKeyStore
-
engineGetCertificateAlias
public String engineGetCertificateAlias(Certificate cert)
- Specified by:
engineGetCertificateAlias
in classKeyStore
-
engineSetCertificateEntry
public void engineSetCertificateEntry(String alias, Certificate cert)
- Specified by:
engineSetCertificateEntry
in classKeyStore
-
-