| Constructor and Description |
|---|
SmimeKeyStore(InputStream stream,
char[] password)
Creates a new
SmimeKeyStore by loading a PKCS12 keystore from a
the given input stream. |
SmimeKeyStore(InputStream stream,
char[] password,
boolean discardPassword)
Creates a new
SmimeKeyStore by loading a PKCS12 keystore from a
the given input stream. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsPrivateKeyAlias(String alias)
Checks if the given alias exists in the PKCS12 keystore.
|
SmimeKey |
getPrivateKey(String alias,
char[] password)
Returns the S/MIME key associated with the given alias, using the given
password to recover it.
|
SmimeKey |
getPrivateKey(String alias,
char[] password,
boolean discardPassword)
Returns the S/MIME key associated with the given alias, using the given
password to recover it.
|
Set<String> |
getPrivateKeyAliases()
Returns a set containing all aliases listed in the PKCS12 keystore.
|
int |
size()
Returns the number of entries in the underlying PKCS12 keystore.
|
public SmimeKeyStore(InputStream stream, char[] password)
SmimeKeyStore by loading a PKCS12 keystore from a
the given input stream.
The character array holding the password is overwritten with 0s
after it has been used.
stream - The InputStream to read the PKCS12 keystore from.password - The password to unlock the PKCS12 keystore with.public SmimeKeyStore(InputStream stream, char[] password, boolean discardPassword)
SmimeKeyStore by loading a PKCS12 keystore from a
the given input stream.
If discardPassword is set to true, the character array
holding the password is overwritten with 0s after it has been
used.
stream - The InputStream to read the PKCS12 keystore from.password - The password to unlock the PKCS12 keystore with.discardPassword - Whether to overwrite the char[] holding the password
after it has been used.public int size()
KeyStore.public SmimeKey getPrivateKey(String alias, char[] password)
The character array holding the password is overwritten with 0s
after it has been used.
alias - The alias.password - The password to unlock the PrivateKey keystore with.SmimeKey, or null if the given alias does
not exist or does not identify a private key entry.public SmimeKey getPrivateKey(String alias, char[] password, boolean discardPassword)
If discardPassword is set to true, the character array
holding the password is overwritten with 0s after it has been
used.
alias - The alias.password - The password to unlock the PrivateKey keystore with.discardPassword - Whether to overwrite the char[] holding the password
after it has been used.SmimeKey, or null if the given alias does
not exist or does not identify a private key entry.public Set<String> getPrivateKeyAliases()
unmodifiable set of
aliases.public boolean containsPrivateKeyAlias(String alias)
alias - The alias to look for.true if the alias exists, false otherwise.Copyright © 2015–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.