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.booleanengineContainsAlias(String alias)voidengineDeleteEntry(String alias)Deletes the entry from sdkmsStringengineGetCertificateAlias(Certificate cert)Certificate[]engineGetCertificateChain(String alias)Throw an exception as we do not store certificate chain.DateengineGetCreationDate(String alias)KeyengineGetKey(String name, char[] password)Returns the key associated with the given alias, using the given password to recover it.booleanengineIsCertificateEntry(String alias)booleanengineIsKeyEntry(String alias)voidengineLoad(InputStream stream, char[] password)Loads the groupid from the given input stream.voidengineSetCertificateEntry(String alias, Certificate cert)voidengineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain)intengineSize()throw exception as we do not get the size from sdkms.voidengineStore(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:
engineLoadin 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:
engineStorein classKeyStore- Throws:
IOException
-
engineAliases
public Enumeration<String> engineAliases()
Lists all the alias names of this keystore.- Specified by:
engineAliasesin 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:
engineGetCertificateChainin classKeyStore
-
engineGetCreationDate
public Date engineGetCreationDate(String alias)
- Specified by:
engineGetCreationDatein 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:
engineGetKeyin 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:
NoSuchAlgorithmExceptionUnrecoverableKeyException
-
engineSetKeyEntry
public void engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) throws KeyStoreException
- Specified by:
engineSetKeyEntryin classKeyStore- Throws:
KeyStoreException
-
engineDeleteEntry
public void engineDeleteEntry(String alias) throws KeyStoreException
Deletes the entry from sdkms- Specified by:
engineDeleteEntryin classKeyStore- Throws:
KeyStoreException
-
engineContainsAlias
public boolean engineContainsAlias(String alias)
- Specified by:
engineContainsAliasin classKeyStoreSpi
-
engineSize
public int engineSize()
throw exception as we do not get the size from sdkms.- Specified by:
engineSizein classKeyStore
-
engineIsKeyEntry
public boolean engineIsKeyEntry(String alias)
- Specified by:
engineIsKeyEntryin classKeyStore
-
engineIsCertificateEntry
public boolean engineIsCertificateEntry(String alias)
- Specified by:
engineIsCertificateEntryin classKeyStore
-
engineGetCertificateAlias
public String engineGetCertificateAlias(Certificate cert)
- Specified by:
engineGetCertificateAliasin classKeyStore
-
engineSetCertificateEntry
public void engineSetCertificateEntry(String alias, Certificate cert)
- Specified by:
engineSetCertificateEntryin classKeyStore
-
-