public class PEMKeyStore extends KeyStoreSpi
Modifier and Type | Field and Description |
---|---|
static String |
CERTIFICATE_FILENAME |
static String |
DEFAULT_DIRECTORY_KEY |
static String |
DIRECTORY_LIST_KEY |
static String |
KEY_FILENAME |
static String |
PROXY_FILENAME |
Constructor and Description |
---|
PEMKeyStore() |
Modifier and Type | Method and Description |
---|---|
Enumeration<String> |
engineAliases()
Get an enumertion of all of the aliases in this keystore.
|
boolean |
engineContainsAlias(String s)
Does the specified alias exist in this keystore?
|
void |
engineDeleteEntry(String s)
Delete a security object from this keystore.
|
Certificate |
engineGetCertificate(String s)
Get the certificate referenced by the supplied alias.
|
String |
engineGetCertificateAlias(Certificate certificate)
Get the alias associated with the supplied certificate.
|
Certificate[] |
engineGetCertificateChain(String s)
Get the certificateChain for the key referenced by the alias.
|
Date |
engineGetCreationDate(String s)
Get the creation date for the object referenced by the alias.
|
Key |
engineGetKey(String s,
char[] chars)
Get the key referenced by the specified alias.
|
boolean |
engineIsCertificateEntry(String s)
Does the supplied alias refer to a certificate in this keystore?
|
boolean |
engineIsKeyEntry(String s)
Does the supplied alias refer to a key in this key store.
|
void |
engineLoad(InputStream inputStream,
char[] chars)
Load the keystore from the supplied input stream.
|
void |
engineLoad(KeyStore.LoadStoreParameter loadStoreParameter)
Load the keystore based on parameters in the LoadStoreParameter.
|
void |
engineSetCertificateEntry(String alias,
Certificate certificate)
Add a certificate to the keystore.
|
void |
engineSetKeyEntry(String s,
byte[] bytes,
Certificate[] certificates)
currently unsupported.
|
void |
engineSetKeyEntry(String s,
Key key,
char[] chars,
Certificate[] certificates)
Add a new private key to the keystore.
|
int |
engineSize()
Get the number of security objects stored in this keystore.
|
void |
engineStore(OutputStream outputStream,
char[] chars)
Persist the security material in this keystore.
|
void |
setCACertStore(ResourceSecurityWrapperStore<ResourceTrustAnchor,TrustAnchor> caCertStore) |
void |
setProxyDelegate(ResourceSecurityWrapperStore<ResourceProxyCredential,X509Credential> proxyDelegate) |
engineEntryInstanceOf, engineGetEntry, engineSetEntry, engineStore
public static final String DEFAULT_DIRECTORY_KEY
public static final String DIRECTORY_LIST_KEY
public static final String CERTIFICATE_FILENAME
public static final String KEY_FILENAME
public static final String PROXY_FILENAME
public void setCACertStore(ResourceSecurityWrapperStore<ResourceTrustAnchor,TrustAnchor> caCertStore)
public void setProxyDelegate(ResourceSecurityWrapperStore<ResourceProxyCredential,X509Credential> proxyDelegate)
public Key engineGetKey(String s, char[] chars) throws NoSuchAlgorithmException, UnrecoverableKeyException
engineGetKey
in class KeyStoreSpi
s
- The key's alias.chars
- The key's password.NoSuchAlgorithmException
- If the key is encoded with an invalid algorithm.UnrecoverableKeyException
- If the key can not be retrieved.public boolean engineIsKeyEntry(String s)
engineIsKeyEntry
in class KeyStoreSpi
s
- The alias.public void engineStore(OutputStream outputStream, char[] chars) throws IOException, NoSuchAlgorithmException, CertificateException
engineStore
in class KeyStoreSpi
outputStream
- This parameter is ignored.chars
- This parameter is ignored.IOException
NoSuchAlgorithmException
CertificateException
public Date engineGetCreationDate(String s)
engineGetCreationDate
in class KeyStoreSpi
s
- The alias of the security object.public String engineGetCertificateAlias(Certificate certificate)
engineGetCertificateAlias
in class KeyStoreSpi
certificate
- The certificate to querypublic Certificate[] engineGetCertificateChain(String s)
engineGetCertificateChain
in class KeyStoreSpi
s
- The key alias.public Certificate engineGetCertificate(String s)
engineGetCertificate
in class KeyStoreSpi
s
- The alias.public void engineLoad(KeyStore.LoadStoreParameter loadStoreParameter) throws IOException, NoSuchAlgorithmException, CertificateException
engineLoad
in class KeyStoreSpi
loadStoreParameter
- The parameters to load.IOException
NoSuchAlgorithmException
CertificateException
public void engineLoad(InputStream inputStream, char[] chars) throws IOException, NoSuchAlgorithmException, CertificateException
engineLoad
in class KeyStoreSpi
inputStream
- An input stream to the properties file.chars
- The password is not used.IOException
NoSuchAlgorithmException
CertificateException
public void engineDeleteEntry(String s) throws KeyStoreException
engineDeleteEntry
in class KeyStoreSpi
s
- The alias of the object to delete.KeyStoreException
public Enumeration<String> engineAliases()
engineAliases
in class KeyStoreSpi
public void engineSetKeyEntry(String s, Key key, char[] chars, Certificate[] certificates) throws KeyStoreException
engineSetKeyEntry
in class KeyStoreSpi
s
- The alias for the object.key
- The private key.chars
- The password.certificates
- The key's certificate chain.KeyStoreException
public void engineSetKeyEntry(String s, byte[] bytes, Certificate[] certificates) throws KeyStoreException
engineSetKeyEntry
in class KeyStoreSpi
s
- The key's aliasbytes
- The encoded private key.certificates
- The key's certificate chain.KeyStoreException
public boolean engineContainsAlias(String s)
engineContainsAlias
in class KeyStoreSpi
s
- The alias.public int engineSize()
engineSize
in class KeyStoreSpi
public boolean engineIsCertificateEntry(String s)
engineIsCertificateEntry
in class KeyStoreSpi
s
- The alias.public void engineSetCertificateEntry(String alias, Certificate certificate) throws KeyStoreException
engineSetCertificateEntry
in class KeyStoreSpi
alias
- The certificate alias.certificate
- The certificate to store.KeyStoreException
Copyright © 2016. All rights reserved.