org.eclipse.osgi.internal.service.security
Class KeyStoreTrustEngine

java.lang.Object
  extended by org.eclipse.osgi.service.security.TrustEngine
      extended by org.eclipse.osgi.internal.service.security.KeyStoreTrustEngine

public class KeyStoreTrustEngine
extends TrustEngine


Constructor Summary
KeyStoreTrustEngine(String path, String type, char[] password, String name)
          Create a new KeyStoreTrustEngine that is backed by a KeyStore
 
Method Summary
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.
 
Methods inherited from class org.eclipse.osgi.service.security.TrustEngine
addTrustAnchor, removeTrustAnchor, removeTrustAnchor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyStoreTrustEngine

public KeyStoreTrustEngine(String path,
                           String type,
                           char[] password,
                           String name)
Create a new KeyStoreTrustEngine that is backed by a KeyStore

Parameters:
path - - path to the keystore
type - - the type of keystore at the path location
password - - the password required to unlock the keystore
Method Detail

findTrustAnchor

public Certificate findTrustAnchor(Certificate[] certChain)
                            throws IOException
Description copied from class: TrustEngine
Returns 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 then null is returned.

Specified by:
findTrustAnchor in class TrustEngine
Parameters:
certChain - - 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

doAddTrustAnchor

protected String doAddTrustAnchor(Certificate cert,
                                  String alias)
                           throws IOException,
                                  GeneralSecurityException
Description copied from class: TrustEngine
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. If null is used as the alias then an alias will be generated based on the trust anchor certificate.

Specified by:
doAddTrustAnchor in class TrustEngine
Parameters:
cert - - 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 null value 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

doRemoveTrustAnchor

protected void doRemoveTrustAnchor(Certificate cert)
                            throws IOException,
                                   GeneralSecurityException
Description copied from class: TrustEngine
Remove a trust anchor point from the engine, based on the certificate itself.

Specified by:
doRemoveTrustAnchor in class TrustEngine
Parameters:
cert - - the certificate to be removed
Throws:
IOException - if there is a problem connecting to the backing store
GeneralSecurityException - if there is a certificate problem

doRemoveTrustAnchor

protected void doRemoveTrustAnchor(String alias)
                            throws IOException,
                                   GeneralSecurityException
Description copied from class: TrustEngine
Remove a trust anchor point from the engine, based on the human readable "friendly name"

Specified by:
doRemoveTrustAnchor in class TrustEngine
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

getTrustAnchor

public Certificate getTrustAnchor(String alias)
                           throws IOException,
                                  GeneralSecurityException
Description copied from class: TrustEngine
Return the certificate associated with the unique "friendly name" in the engine.

Specified by:
getTrustAnchor in class TrustEngine
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

getAliases

public String[] getAliases()
                    throws IOException,
                           GeneralSecurityException
Description copied from class: TrustEngine
Return the list of friendly name aliases for the TrustAnchors installed in the engine.

Specified by:
getAliases in class TrustEngine
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

isReadOnly

public boolean isReadOnly()
Description copied from class: TrustEngine
Return a value indicate whether this trust engine is read-only.

Specified by:
isReadOnly in class TrustEngine
Returns:
true if this trust engine is read-only false otherwise.

getName

public String getName()
Description copied from class: TrustEngine
Return a representation string of this trust engine

Specified by:
getName in class TrustEngine
Returns:
a string


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.