|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.security.KeyStoreSpi
be.cardon.cryptoapi.provider.CryptoAPIKeyStore
public class CryptoAPIKeyStore
CryptoAPI store wrapper
Nested Class Summary | |
---|---|
class |
CryptoAPIKeyStore.EnumAliases
Enumeration of keys aliases |
Constructor Summary | |
---|---|
CryptoAPIKeyStore()
Creates a new instance of CryptoAPIKeyStore |
Method Summary | |
---|---|
java.util.Enumeration<java.lang.String> |
engineAliases()
Lists all the alias names of this keystore. |
boolean |
engineContainsAlias(java.lang.String alias)
Checks if the given alias exists in this keystore. |
void |
engineDeleteEntry(java.lang.String alias)
NOT IMPLEMENTED : throw KeyStoreException. |
java.security.cert.Certificate |
engineGetCertificate(java.lang.String alias)
Returns the certificate associated with the given alias. |
java.lang.String |
engineGetCertificateAlias(java.security.cert.Certificate cert)
Returns the (alias) name of the first keystore entry whose certificate matches the given certificate, or null if no such entry exists in this keystore. |
java.security.cert.Certificate[] |
engineGetCertificateChain(java.lang.String alias)
Returns the certificate chain associated with the given alias. |
java.util.Date |
engineGetCreationDate(java.lang.String alias)
Returns the creation date of the entry identified by the given alias. |
java.security.Key |
engineGetKey(java.lang.String alias,
char[] password)
Returns the key associated with the given alias. |
boolean |
engineIsCertificateEntry(java.lang.String alias)
Returns true if the entry identified by the given alias was created by a call to setCertificateEntry, or created by a call to setEntry with a TrustedCertificateEntry. |
boolean |
engineIsKeyEntry(java.lang.String alias)
Returns true if the entry identified by the given alias was created by a call to setKeyEntry, or created by a call to setEntry with a PrivateKeyEntry or a SecretKeyEntry. |
void |
engineLoad(java.io.InputStream stream,
char[] password)
Loads the keystore from the given input stream. |
void |
engineSetCertificateEntry(java.lang.String alias,
java.security.cert.Certificate cert)
Assigns the given certificate to the given alias. |
void |
engineSetKeyEntry(java.lang.String alias,
byte[] key,
java.security.cert.Certificate[] chain)
Assigns the given key (that has already been protected) to the given alias. |
void |
engineSetKeyEntry(java.lang.String alias,
java.security.Key key,
char[] password,
java.security.cert.Certificate[] chain)
Assigns the given key to the given alias, protecting it with the given password. |
int |
engineSize()
Retrieves the number of entries in this keystore. |
void |
engineStore(java.io.OutputStream stream,
char[] password)
Stores this keystore using the given KeyStore.LoadStoreParmeter. |
Methods inherited from class java.security.KeyStoreSpi |
---|
engineEntryInstanceOf, engineGetEntry, engineLoad, engineSetEntry, engineStore |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CryptoAPIKeyStore() throws java.io.IOException
java.io.IOException
Method Detail |
---|
public java.util.Enumeration<java.lang.String> engineAliases()
engineAliases
in class java.security.KeyStoreSpi
public boolean engineContainsAlias(java.lang.String alias)
engineContainsAlias
in class java.security.KeyStoreSpi
public void engineDeleteEntry(java.lang.String alias) throws java.security.KeyStoreException
engineDeleteEntry
in class java.security.KeyStoreSpi
java.security.KeyStoreException
public java.security.cert.Certificate engineGetCertificate(java.lang.String alias)
engineGetCertificate
in class java.security.KeyStoreSpi
public java.lang.String engineGetCertificateAlias(java.security.cert.Certificate cert)
engineGetCertificateAlias
in class java.security.KeyStoreSpi
public java.security.cert.Certificate[] engineGetCertificateChain(java.lang.String alias)
engineGetCertificateChain
in class java.security.KeyStoreSpi
public java.util.Date engineGetCreationDate(java.lang.String alias)
engineGetCreationDate
in class java.security.KeyStoreSpi
public java.security.Key engineGetKey(java.lang.String alias, char[] password) throws java.security.UnrecoverableKeyException
WARNING !
The password should be null. This is the default case. The CSP (cryptographic service provider) will display a window (PIN, or other) to the user if needed.
You can also give a password (PIN) programatically. The CSP MUST support the function CryptoAPI function CryptSetProvParam with PP_SIGNATURE_PIN or PP_KEYEXCHANGE_PIN. Most CSP like the Microsoft Basic CSP or the Belgian eid middleware doesn't support this function. The CSP from 'Nexus Personal' has been tested with that. All CSP supporting Smard Card Windows logon should support this function.
.The password doesn't support Unicode (CryptoAPI use byte[], not char[]). In the future, we will create a property to choose the encoding for password.
engineGetKey
in class java.security.KeyStoreSpi
java.security.UnrecoverableKeyException
- if the CryptSetProvParam function is not supported
for PIN, or other error.public boolean engineIsCertificateEntry(java.lang.String alias)
engineIsCertificateEntry
in class java.security.KeyStoreSpi
public boolean engineIsKeyEntry(java.lang.String alias)
engineIsKeyEntry
in class java.security.KeyStoreSpi
public void engineLoad(java.io.InputStream stream, char[] password) throws java.io.IOException
engineLoad
in class java.security.KeyStoreSpi
java.io.IOException
public void engineSetCertificateEntry(java.lang.String alias, java.security.cert.Certificate cert) throws java.security.KeyStoreException
engineSetCertificateEntry
in class java.security.KeyStoreSpi
java.security.KeyStoreException
public void engineSetKeyEntry(java.lang.String alias, byte[] key, java.security.cert.Certificate[] chain) throws java.security.KeyStoreException
engineSetKeyEntry
in class java.security.KeyStoreSpi
java.security.KeyStoreException
public void engineSetKeyEntry(java.lang.String alias, java.security.Key key, char[] password, java.security.cert.Certificate[] chain) throws java.security.KeyStoreException
engineSetKeyEntry
in class java.security.KeyStoreSpi
java.security.KeyStoreException
public int engineSize()
engineSize
in class java.security.KeyStoreSpi
public void engineStore(java.io.OutputStream stream, char[] password)
engineStore
in class java.security.KeyStoreSpi
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |