Class TrustEngine
java.lang.Object
org.eclipse.osgi.service.security.TrustEngine
A 
TrustEngine is used to establish the authenticity of a
 Certificate chain.
 Clients may implement this interface.
- Since:
- 3.4
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddTrustAnchor(Certificate anchor, String alias) Add a trust anchor point to this trust engine.protected abstract StringdoAddTrustAnchor(Certificate anchor, String alias) Add a trust anchor point to this trust engine.protected abstract voiddoRemoveTrustAnchor(String alias) Remove a trust anchor point from the engine, based on the human readable "friendly name"protected abstract voiddoRemoveTrustAnchor(Certificate anchor) Remove a trust anchor point from the engine, based on the certificate itself.abstract CertificatefindTrustAnchor(Certificate[] chain) Returns the certificate trust anchor contained in the specified chain which was used to establish the authenticity of the chain.abstract String[]Return the list of friendly name aliases for the TrustAnchors installed in the engine.abstract StringgetName()Return a representation string of this trust engineabstract CertificategetTrustAnchor(String alias) Return the certificate associated with the unique "friendly name" in the engine.abstract booleanReturn a value indicate whether this trust engine is read-only.voidremoveTrustAnchor(String alias) Remove a trust anchor point from the engine, based on the human readable "friendly name"final voidremoveTrustAnchor(Certificate anchor) Remove a trust anchor point from the engine, based on the certificate itself.
- 
Constructor Details- 
TrustEnginepublic TrustEngine()
 
- 
- 
Method Details- 
findTrustAnchorReturns the certificate trust anchor contained in the specified chain which was used to establish the authenticity of the chain. If no trust anchor is found in the chain thennullis returned.- Parameters:
- chain- - a complete or incomplete certificate chain, implementations *MAY* complete chains
- Returns:
- - the certificate trust anchor used to establish authenticity
- Throws:
- IOException- if there is a problem connecting to the backing store
 
- 
addTrustAnchorpublic String addTrustAnchor(Certificate anchor, String alias) throws IOException, GeneralSecurityException Add a trust anchor point to this trust engine. A trust anchor implies that a certificate, and any of its children, is to be considered trusted. Ifnullis used as the alias then an alias will be generated based on the trust anchor certificate.- Parameters:
- anchor- - the certificate to add as an anchor point
- alias- - a unique and human-readable 'friendly name' which can be used to reference the certificate. A- nullvalue may be used.
- Returns:
- the alias used to store the entry
- Throws:
- IOException- if there is a problem connecting to the backing store
- GeneralSecurityException- if there is a certificate problem
- IllegalArgumentException- if the alias or anchor already exist in this trust engine
 
- 
doAddTrustAnchorprotected abstract String doAddTrustAnchor(Certificate anchor, String alias) throws IOException, GeneralSecurityException Add a trust anchor point to this trust engine. A trust anchor implies that a certificate, and any of its children, is to be considered trusted. Ifnullis used as the alias then an alias will be generated based on the trust anchor certificate.- Parameters:
- anchor- - the certificate to add as an anchor point
- alias- - a unique and human-readable 'friendly name' which can be used to reference the certificate. A- nullvalue may be used.
- Returns:
- the alias used to store the entry
- Throws:
- IOException- if there is a problem connecting to the backing store
- GeneralSecurityException- if there is a certificate problem
- IllegalArgumentException- if the alias or anchor already exist in this trust engine
 
- 
removeTrustAnchorpublic final void removeTrustAnchor(Certificate anchor) throws IOException, GeneralSecurityException Remove a trust anchor point from the engine, based on the certificate itself.- Parameters:
- anchor- - the certificate to be removed
- Throws:
- IOException- if there is a problem connecting to the backing store
- GeneralSecurityException- if there is a certificate problem
 
- 
doRemoveTrustAnchorprotected abstract void doRemoveTrustAnchor(Certificate anchor) throws IOException, GeneralSecurityException Remove a trust anchor point from the engine, based on the certificate itself.- Parameters:
- anchor- - the certificate to be removed
- Throws:
- IOException- if there is a problem connecting to the backing store
- GeneralSecurityException- if there is a certificate problem
 
- 
removeTrustAnchorRemove a trust anchor point from the engine, based on the human readable "friendly name"- Parameters:
- alias- - the name of the trust anchor
- Throws:
- IOException- if there is a problem connecting to the backing store
- GeneralSecurityException- if there is a certificate problem
 
- 
doRemoveTrustAnchorprotected abstract void doRemoveTrustAnchor(String alias) throws IOException, GeneralSecurityException Remove a trust anchor point from the engine, based on the human readable "friendly name"- Parameters:
- alias- - the name of the trust anchor
- Throws:
- IOException- if there is a problem connecting to the backing store
- GeneralSecurityException- if there is a certificate problem
 
- 
getTrustAnchorpublic abstract Certificate getTrustAnchor(String alias) throws IOException, GeneralSecurityException Return the certificate associated with the unique "friendly name" in the engine.- Parameters:
- alias- - the friendly name
- Returns:
- the associated trust anchor
- Throws:
- IOException- if there is a problem connecting to the backing store
- GeneralSecurityException- if there is a certificate problem
 
- 
getAliasesReturn the list of friendly name aliases for the TrustAnchors installed in the engine.- Returns:
- string[] - the list of friendly name aliases
- Throws:
- IOException- if there is a problem connecting to the backing store
- GeneralSecurityException- if there is a certificate problem
 
- 
isReadOnlypublic abstract boolean isReadOnly()Return a value indicate whether this trust engine is read-only.- Returns:
- true if this trust engine is read-only false otherwise.
 
- 
getNameReturn a representation string of this trust engine- Returns:
- a string
 
 
-