public class KeyStoreTrustEngine extends TrustEngine
Constructor and Description |
---|
KeyStoreTrustEngine(String path,
String type,
char[] password,
String name)
Create a new KeyStoreTrustEngine that is backed by a KeyStore
|
Modifier and Type | Method and Description |
---|---|
protected String |
doAddTrustAnchor(Certificate cert,
String alias)
Add a trust anchor point to this trust engine.
|
protected void |
doRemoveTrustAnchor(Certificate cert)
Remove a trust anchor point from the engine, based on the certificate itself.
|
protected void |
doRemoveTrustAnchor(String alias)
Remove a trust anchor point from the engine, based on the human readable "friendly name"
|
Certificate |
findTrustAnchor(Certificate[] certChain)
Returns the certificate trust anchor contained in the specified chain which
was used to establish the authenticity of the chain.
|
String[] |
getAliases()
Return the list of friendly name aliases for the TrustAnchors installed in the engine.
|
String |
getName()
Return a representation string of this trust engine
|
Certificate |
getTrustAnchor(String alias)
Return the certificate associated with the unique "friendly name" in the engine.
|
boolean |
isReadOnly()
Return a value indicate whether this trust engine is read-only.
|
addTrustAnchor, removeTrustAnchor, removeTrustAnchor
public KeyStoreTrustEngine(String path, String type, char[] password, String name)
path
- - path to the keystoretype
- - the type of keystore at the path locationpassword
- - the password required to unlock the keystorepublic Certificate findTrustAnchor(Certificate[] certChain) throws IOException
TrustEngine
null
is returned.findTrustAnchor
in class TrustEngine
certChain
- - a complete or incomplete certificate chain, implementations *MAY* complete chainsIOException
- if there is a problem connecting to the backing storeprotected String doAddTrustAnchor(Certificate cert, String alias) throws IOException, GeneralSecurityException
TrustEngine
null
is used
as the alias then an alias will be generated based on the trust anchor certificate.doAddTrustAnchor
in class TrustEngine
cert
- - the certificate to add as an anchor pointalias
- - a unique and human-readable 'friendly name' which can be used to reference the certificate.
A null
value may be used.IOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problemprotected void doRemoveTrustAnchor(Certificate cert) throws IOException, GeneralSecurityException
TrustEngine
doRemoveTrustAnchor
in class TrustEngine
cert
- - the certificate to be removedIOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problemprotected void doRemoveTrustAnchor(String alias) throws IOException, GeneralSecurityException
TrustEngine
doRemoveTrustAnchor
in class TrustEngine
alias
- - the name of the trust anchorIOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problempublic Certificate getTrustAnchor(String alias) throws IOException, GeneralSecurityException
TrustEngine
getTrustAnchor
in class TrustEngine
alias
- - the friendly nameIOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problempublic String[] getAliases() throws IOException, GeneralSecurityException
TrustEngine
getAliases
in class TrustEngine
IOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problempublic boolean isReadOnly()
TrustEngine
isReadOnly
in class TrustEngine
public String getName()
TrustEngine
getName
in class TrustEngine
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.