public abstract class TrustEngine extends Object
TrustEngine
is used to establish the authenticity of a
Certificate
chain.
Clients may implement this interface.
Constructor and Description |
---|
TrustEngine() |
Modifier and Type | Method and Description |
---|---|
String |
addTrustAnchor(Certificate anchor,
String alias)
Add a trust anchor point to this trust engine.
|
protected abstract String |
doAddTrustAnchor(Certificate anchor,
String alias)
Add a trust anchor point to this trust engine.
|
protected abstract void |
doRemoveTrustAnchor(Certificate anchor)
Remove a trust anchor point from the engine, based on the certificate itself.
|
protected abstract void |
doRemoveTrustAnchor(String alias)
Remove a trust anchor point from the engine, based on the human readable "friendly name"
|
abstract Certificate |
findTrustAnchor(Certificate[] chain)
Returns the certificate trust anchor contained in the specified chain which
was used to establish the authenticity of the chain.
|
abstract String[] |
getAliases()
Return the list of friendly name aliases for the TrustAnchors installed in the engine.
|
abstract String |
getName()
Return a representation string of this trust engine
|
abstract Certificate |
getTrustAnchor(String alias)
Return the certificate associated with the unique "friendly name" in the engine.
|
abstract boolean |
isReadOnly()
Return a value indicate whether this trust engine is read-only.
|
void |
removeTrustAnchor(Certificate anchor)
Remove a trust anchor point from the engine, based on the certificate itself.
|
void |
removeTrustAnchor(String alias)
Remove a trust anchor point from the engine, based on the human readable "friendly name"
|
public abstract Certificate findTrustAnchor(Certificate[] chain) throws IOException
null
is returned.chain
- - a complete or incomplete certificate chain, implementations *MAY* complete chainsIOException
- if there is a problem connecting to the backing storepublic String addTrustAnchor(Certificate anchor, String alias) throws IOException, GeneralSecurityException
null
is used
as the alias then an alias will be generated based on the trust anchor certificate.anchor
- - 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 problemIllegalArgumentException
- if the alias or anchor already exist in this trust engineprotected abstract String doAddTrustAnchor(Certificate anchor, String alias) throws IOException, GeneralSecurityException
null
is used
as the alias then an alias will be generated based on the trust anchor certificate.anchor
- - 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 problemIllegalArgumentException
- if the alias or anchor already exist in this trust enginepublic final void removeTrustAnchor(Certificate anchor) throws IOException, GeneralSecurityException
anchor
- - the certificate to be removedIOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problemprotected abstract void doRemoveTrustAnchor(Certificate anchor) throws IOException, GeneralSecurityException
anchor
- - the certificate to be removedIOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problempublic void removeTrustAnchor(String alias) throws IOException, GeneralSecurityException
alias
- - the name of the trust anchorIOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problemprotected abstract void doRemoveTrustAnchor(String alias) throws IOException, GeneralSecurityException
alias
- - the name of the trust anchorIOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problempublic abstract Certificate getTrustAnchor(String alias) throws IOException, GeneralSecurityException
alias
- - the friendly nameIOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problempublic abstract String[] getAliases() throws IOException, GeneralSecurityException
IOException
- if there is a problem connecting to the backing storeGeneralSecurityException
- if there is a certificate problempublic abstract boolean isReadOnly()
public abstract String getName()
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.