public class DnieKeyStoreSpi
extends java.security.KeyStoreSpi
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
TYPE_NAME |
Constructor and Description |
---|
DnieKeyStoreSpi() |
Modifier and Type | Method and Description |
---|---|
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)
Operation not supported.
|
boolean |
engineEntryInstanceOf(java.lang.String alias,
java.lang.Class<? extends java.security.KeyStore.Entry> entryClass)
Determines if the keystore
Entry for the specified
alias is an instance or subclass of the specified
entryClass . |
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.
|
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)
Operation not supported.
|
java.security.KeyStore.Entry |
engineGetEntry(java.lang.String alias,
java.security.KeyStore.ProtectionParameter protParam)
Gets a
KeyStore.Entry for the specified alias
with the specified protection parameter. |
java.security.Key |
engineGetKey(java.lang.String alias,
char[] password)
Returns the key associated with the given alias, using the given
password to recover it.
|
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 |
engineLoad(java.security.KeyStore.LoadStoreParameter param)
Loads the keystore using the given
KeyStore.LoadStoreParameter . |
void |
engineSetCertificateEntry(java.lang.String alias,
java.security.cert.Certificate cert)
Operation not supported.
|
void |
engineSetKeyEntry(java.lang.String alias,
byte[] key,
java.security.cert.Certificate[] chain)
Operation not supported.
|
void |
engineSetKeyEntry(java.lang.String alias,
java.security.Key key,
char[] pass,
java.security.cert.Certificate[] chain)
Operation not supported.
|
int |
engineSize()
Retrieves the number of entries in this keystore.
|
void |
engineStore(java.io.OutputStream os,
char[] pass)
Operation not supported.
|
ApduConnection |
getConnection() |
protected static final java.lang.String TYPE_NAME
public ApduConnection getConnection()
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
alias
- the alias namepublic void engineDeleteEntry(java.lang.String alias)
engineDeleteEntry
in class java.security.KeyStoreSpi
alias
- the alias namepublic java.security.cert.Certificate engineGetCertificate(java.lang.String alias)
If the given alias name identifies an entry
created by a call to setCertificateEntry
,
or created by a call to setEntry
with a
TrustedCertificateEntry
,
then the trusted certificate contained in that entry is returned.
If the given alias name identifies an entry
created by a call to setKeyEntry
,
or created by a call to setEntry
with a
PrivateKeyEntry
,
then the first element of the certificate chain in that entry
(if a chain exists) is returned.
engineGetCertificate
in class java.security.KeyStoreSpi
alias
- the alias namepublic java.lang.String engineGetCertificateAlias(java.security.cert.Certificate cert)
This method attempts to match the given certificate with each
keystore entry. If the entry being considered was
created by a call to setCertificateEntry
,
or created by a call to setEntry
with a
TrustedCertificateEntry
,
then the given certificate is compared to that entry's certificate.
If the entry being considered was
created by a call to setKeyEntry
,
or created by a call to setEntry
with a
PrivateKeyEntry
,
then the given certificate is compared to the first
element of that entry's certificate chain.
engineGetCertificateAlias
in class java.security.KeyStoreSpi
cert
- the certificate to match with.public java.security.cert.Certificate[] engineGetCertificateChain(java.lang.String alias)
setKeyEntry
,
or by a call to setEntry
with a
PrivateKeyEntry
.engineGetCertificateChain
in class java.security.KeyStoreSpi
alias
- the alias namepublic java.util.Date engineGetCreationDate(java.lang.String alias)
engineGetCreationDate
in class java.security.KeyStoreSpi
alias
- the alias namepublic java.security.Key engineGetKey(java.lang.String alias, char[] password)
setKeyEntry
,
or by a call to setEntry
with a
PrivateKeyEntry
or SecretKeyEntry
.engineGetKey
in class java.security.KeyStoreSpi
alias
- the alias namepassword
- the password for recovering the keypublic java.security.KeyStore.Entry engineGetEntry(java.lang.String alias, java.security.KeyStore.ProtectionParameter protParam)
KeyStore.Entry
for the specified alias
with the specified protection parameter.engineGetEntry
in class java.security.KeyStoreSpi
alias
- get the KeyStore.Entry
for this aliasprotParam
- the ProtectionParameter
used to protect the Entry
,
which may be null
KeyStore.Entry
for the specified alias,
or null
if there is no such entrypublic boolean engineIsCertificateEntry(java.lang.String alias)
setCertificateEntry
,
or created by a call to setEntry
with a
TrustedCertificateEntry
.engineIsCertificateEntry
in class java.security.KeyStoreSpi
alias
- the alias for the keystore entry to be checkedpublic boolean engineIsKeyEntry(java.lang.String alias)
setKeyEntry
,
or created by a call to setEntry
with a
PrivateKeyEntry
or a SecretKeyEntry
.engineIsKeyEntry
in class java.security.KeyStoreSpi
alias
- the alias for the keystore entry to be checkedpublic void engineLoad(java.security.KeyStore.LoadStoreParameter param) throws java.io.IOException
KeyStore.LoadStoreParameter
.
Note that if this KeyStore has already been loaded, it is reinitialized and loaded again from the given parameter.
engineLoad
in class java.security.KeyStoreSpi
param
- the KeyStore.LoadStoreParameter
that specifies how to load the keystore,
which may be null
java.io.IOException
- if there is an I/O or format problem with the
keystore data. If the error is due to an incorrect
ProtectionParameter
(e.g. wrong password)
the cause
of the
IOException
should be an
UnrecoverableKeyException
public void engineLoad(java.io.InputStream stream, char[] password)
A password may be given to unlock the keystore (e.g. the keystore resides on a hardware token device), or to check the integrity of the keystore data. If a password is not given for integrity checking, then integrity checking is not performed.
engineLoad
in class java.security.KeyStoreSpi
stream
- the input stream from which the keystore is loaded,
or null
password
- the password used to check the integrity of
the keystore, the password used to unlock the keystore,
or null
public void engineSetCertificateEntry(java.lang.String alias, java.security.cert.Certificate cert)
engineSetCertificateEntry
in class java.security.KeyStoreSpi
alias
- the alias namecert
- the certificatepublic void engineSetKeyEntry(java.lang.String alias, byte[] key, java.security.cert.Certificate[] chain) throws java.security.KeyStoreException
engineSetKeyEntry
in class java.security.KeyStoreSpi
alias
- the alias namekey
- the key (in protected format) to be associated with the aliaschain
- the certificate chain for the corresponding public
key (only useful if the protected key is of type
java.security.PrivateKey
).java.security.KeyStoreException
- if this operation fails.public void engineSetKeyEntry(java.lang.String alias, java.security.Key key, char[] pass, java.security.cert.Certificate[] chain) throws java.security.KeyStoreException
engineSetKeyEntry
in class java.security.KeyStoreSpi
alias
- the alias namekey
- the key to be associated with the aliaspass
- the password to protect the keychain
- the certificate chain for the corresponding public
key (only required if the given key is of type
java.security.PrivateKey
).java.security.KeyStoreException
- if the given key cannot be protected, or
this operation fails for some other reasonpublic int engineSize()
engineSize
in class java.security.KeyStoreSpi
public void engineStore(java.io.OutputStream os, char[] pass)
engineStore
in class java.security.KeyStoreSpi
os
- the output stream to which this keystore is written.pass
- the password to generate the keystore integrity checkpublic boolean engineEntryInstanceOf(java.lang.String alias, java.lang.Class<? extends java.security.KeyStore.Entry> entryClass)
Entry
for the specified
alias
is an instance or subclass of the specified
entryClass
.engineEntryInstanceOf
in class java.security.KeyStoreSpi
alias
- the alias nameentryClass
- the entry classEntry
for the specified
alias
is an instance or subclass of the
specified entryClass
, false otherwise