public abstract class KeyStoreAddressBook
extends java.security.KeyStoreSpi
sun.security.mscapi.KeyStore
modificada para acceder a los
almacenes de CAPI ADDRESSBOOK y CA.Modifier and Type | Class and Description |
---|---|
static class |
KeyStoreAddressBook.ADDRESSBOOK
KeyStore ADDRESSBOOK de CAPI.
|
static class |
KeyStoreAddressBook.CA
KeyStore CA de CAPI.
|
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)
Deletes the entry identified by the given alias from this keystore.
|
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)
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 is a trusted
certificate entry, and false otherwise.
|
boolean |
engineIsKeyEntry(java.lang.String alias)
Returns true if the entry identified by the given alias is a key
entry, and false otherwise.
|
void |
engineLoad(java.io.InputStream stream,
char[] password)
Loads the keystore.
|
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)
Stores the given private key and associated certificate chain in the
keystore.
|
int |
engineSize()
Retrieves the number of entries in this keystore.
|
void |
engineStore(java.io.OutputStream stream,
char[] password)
engineStore is currently a no-op.
|
public final java.security.Key engineGetKey(java.lang.String alias, char[] password)
A compatibility mode is supported for applications that assume a password must be supplied. It permits (but ignores) a non-null
password
. The mode is enabled by default. Set the sun.security.mscapi.keyStoreCompatibilityMode
system property to
false
to disable compatibility mode and reject a non-null password
.
engineGetKey
in class java.security.KeyStoreSpi
alias
- the alias namepassword
- the password, which should be null
public final java.security.cert.Certificate[] engineGetCertificateChain(java.lang.String alias)
engineGetCertificateChain
in class java.security.KeyStoreSpi
alias
- the alias namepublic final java.security.cert.Certificate engineGetCertificate(java.lang.String alias)
If the given alias name identifies a trusted certificate entry, the certificate associated with that entry is returned. If the given alias name identifies a key entry, the first element of the certificate chain of that entry is returned, or null if that entry does not have a certificate chain.
engineGetCertificate
in class java.security.KeyStoreSpi
alias
- the alias namepublic final java.util.Date engineGetCreationDate(java.lang.String alias)
engineGetCreationDate
in class java.security.KeyStoreSpi
alias
- the alias namepublic final void engineSetKeyEntry(java.lang.String alias, java.security.Key key, char[] password, java.security.cert.Certificate[] chain)
The given java.security.PrivateKey key
must be accompanied by a certificate chain certifying the corresponding public key.
If the given alias already exists, the keystore information associated with it is overridden by the given key and certificate chain. Otherwise, a new entry is created.
A compatibility mode is supported for applications that assume a password must be supplied. It permits (but ignores) a non-null
password
. The mode is enabled by default. Set the sun.security.mscapi.keyStoreCompatibilityMode
system property to
false
to disable compatibility mode and reject a non-null password
.
engineSetKeyEntry
in class java.security.KeyStoreSpi
alias
- the alias namekey
- the private key to be associated with the aliaspassword
- the password, which should be null
chain
- the certificate chain for the corresponding public key (only
required if the given key is of type java.security.PrivateKey
).public final void engineSetKeyEntry(java.lang.String alias, byte[] key, java.security.cert.Certificate[] chain)
If the protected key is of type java.security.PrivateKey
, it must be accompanied by a certificate chain certifying the
corresponding public key. If the underlying keystore implementation is of type jks
, key
must be encoded as an
EncryptedPrivateKeyInfo
as defined in the PKCS #8 standard.
If the given alias already exists, the keystore information associated with it is overridden by the given key (and possibly certificate chain).
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
).public final void engineSetCertificateEntry(java.lang.String alias, java.security.cert.Certificate cert)
If the given alias already exists in this keystore and identifies a trusted certificate entry, the certificate associated with it is overridden by the given certificate.
engineSetCertificateEntry
in class java.security.KeyStoreSpi
alias
- the alias namecert
- the certificate.public final void engineDeleteEntry(java.lang.String alias)
engineDeleteEntry
in class java.security.KeyStoreSpi
alias
- the alias name.public final java.util.Enumeration<java.lang.String> engineAliases()
engineAliases
in class java.security.KeyStoreSpi
public final boolean engineContainsAlias(java.lang.String alias)
engineContainsAlias
in class java.security.KeyStoreSpi
alias
- the alias namepublic final int engineSize()
engineSize
in class java.security.KeyStoreSpi
public final boolean engineIsKeyEntry(java.lang.String alias)
engineIsKeyEntry
in class java.security.KeyStoreSpi
public final boolean engineIsCertificateEntry(java.lang.String alias)
engineIsCertificateEntry
in class java.security.KeyStoreSpi
public final 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 is a trusted certificate entry, the given certificate is compared to that entry's certificate. If the entry being considered is a key entry, the given certificate is compared to the first element of that entry's certificate chain (if a chain exists).
engineGetCertificateAlias
in class java.security.KeyStoreSpi
cert
- the certificate to match with.public final void engineStore(java.io.OutputStream stream, char[] password)
engineStore
in class java.security.KeyStoreSpi
stream
- the output stream, which should be null
password
- the password, which should be null
.public final void engineLoad(java.io.InputStream stream, char[] password) throws java.io.IOException
stream
or password
. The mode is enabled by default. Set the
sun.security.mscapi.keyStoreCompatibilityMode
system
property to false
to disable compatibility mode and reject a
non-null stream
or password
.engineLoad
in class java.security.KeyStoreSpi
stream
- the input stream, which should be null
.password
- the password, which should be null
.java.io.IOException
- if there is an I/O or format problem with the keystore
data. Or if compatibility mode is disabled and either
parameter is non-null.java.lang.SecurityException
- if the security check for SecurityPermission("authProvider.name")
does not pass, where name is the value
returned by
this provider's getName
method.