|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Class representing the protected key store used for storage of key material for asymetric cryptography and trusted certificates. KeyStore is organized into key entries that are are indexed by aliases. Key entry represents trusted certificate chain or private key with associated certificates.
Method Summary | |
boolean |
containsAlias(java.lang.String alias)
Determines whether the store contains given alias. |
void |
deleteEntry(java.lang.String alias)
Deletes entry identified by an alias. |
java.lang.String |
getAlias(java.security.cert.Certificate cert)
Returns alias the certificate is associated with. |
AliasEntry[] |
getAliasEntries()
Returns all aliases in the key store with the description of their type (i.e. |
java.lang.String[] |
getAliases()
Returns all aliases in the key store. |
java.security.cert.Certificate[] |
getCertificateChain(java.lang.String alias)
Returns certificate chain associated with an alias. |
java.security.Key |
getKey(java.lang.String alias,
java.lang.String password)
Returns the key associated with given alias and protected by given password. |
KeyEntry |
getKeyEntry(java.lang.String alias)
Returns encrypted key material in the KeyStoreEntry
instance. |
boolean |
isKeyEntry(java.lang.String alias)
Determines whether the entry identified by an alias is a key entry. |
void |
setCertificateEntry(java.lang.String alias,
java.security.cert.Certificate[] chain)
Creates or overwrites trusted certificate entry. |
void |
setKeyEntry(java.lang.String alias,
byte[] encKey,
byte[] keyAlg,
byte[] keyFormat,
byte[] salt,
java.security.cert.Certificate[] chain)
Creates or overwrites key entry using the data of the encoded key. |
void |
setKeyEntry(java.lang.String alias,
java.lang.String password,
java.security.Key key,
java.security.cert.Certificate[] chain)
Creates or overwrites key entry. |
void |
setKeyStoreSoure(KeyStoreSource source)
Sets KeyStoreSource associated with this KeyStore to the given object. |
Method Detail |
public boolean containsAlias(java.lang.String alias)
alias
- alias name to look for
true
if the alias existspublic void deleteEntry(java.lang.String alias) throws KeyStoreException
alias
- key entry alias
KeyStoreException
- error during processingpublic java.security.cert.Certificate[] getCertificateChain(java.lang.String alias) throws KeyStoreException
alias
- alias name to return certificate chain for
KeyStoreException
public java.lang.String getAlias(java.security.cert.Certificate cert)
cert
- certificate that has to be associated with the returned alias
null
, if there is no such certificatepublic java.lang.String[] getAliases()
public AliasEntry[] getAliasEntries()
public java.security.Key getKey(java.lang.String alias, java.lang.String password) throws BadPasswordException, KeyStoreException
alias
- alias name to return the key forpassword
- password to use for key unprotection
BadPasswordException
- if bad password was used
KeyStoreException
public boolean isKeyEntry(java.lang.String alias)
alias
- entry's alias name
true
if the entry is a key entrypublic void setCertificateEntry(java.lang.String alias, java.security.cert.Certificate[] chain) throws BadPasswordException, KeyStoreException
alias
- entry's alias namechain
- certificates chain to be associated with given alias
BadPasswordException
KeyStoreException
public KeyEntry getKeyEntry(java.lang.String alias) throws KeyStoreException
KeyStoreEntry
instance.
alias
- alias of the key entry to be returned
KeyStoreEntry
interface
containing encrypted key info
KeyStoreException
public void setKeyEntry(java.lang.String alias, java.lang.String password, java.security.Key key, java.security.cert.Certificate[] chain) throws BadPasswordException, KeyStoreException
alias
- entry's alias namepassword
- password for protecting the associated keykey
- cryptographic key to be associated with the entrychain
- certificate chain to associate with the entry (usually
contains public key corresponding to the private key specified in
key parameter
BadPasswordException
KeyStoreException
public void setKeyEntry(java.lang.String alias, byte[] encKey, byte[] keyAlg, byte[] keyFormat, byte[] salt, java.security.cert.Certificate[] chain) throws BadPasswordException, KeyStoreException
alias
- entry's alias nameencKey
- encypted key materialkeyAlg
- encrypted key algorithmkeyFormat
- encrypted format of the encoded key (after decryption
of the encKey byte array)salt
- salt value used for the encryption of the key infochain
- certificate chain to associate with the entry
BadPasswordException
KeyStoreException
public void setKeyStoreSoure(KeyStoreSource source)
source
- the given KeyStoreSource to set to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |