Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

net.jxta.impl.membership.pse
Class PSEConfig  view PSEConfig download PSEConfig.java

java.lang.Object
  extended bynet.jxta.impl.membership.pse.PSEConfig

public final class PSEConfig
extends java.lang.Object

Manages the state of a Personal Security Enviroment.


Field Summary
private  KeyStoreManager keystore_manager
          Manager for the keystore we are using.
private  char[] keystore_password
          The keystore password.
private static org.apache.log4j.Logger LOG
          Log4J Logger
 
Constructor Summary
PSEConfig(KeyStoreManager storeManager, char[] password)
          Standard constructor.
 
Method Summary
 void erase()
          Remove an existing PSE enviroment.
 void erase(net.jxta.id.ID id)
          Erases the specified id from the keystore.
protected  void finalize()
          null
 java.security.PrivateKey getKey(net.jxta.id.ID id, char[] key_password)
          Returns the private key for the specified ID.
 net.jxta.id.ID[] getKeysList()
          Returns the list of root certificates for which there is an associated local private key.
(package private)  net.jxta.id.ID[] getKeysList(char[] store_password)
          Returns the list of root certificates for which there is an associated local private key.
 java.security.KeyStore getKeyStore()
          Gets a copy of the keystore associated with this PSE instance.
 java.security.cert.X509Certificate getTrustedCertificate(net.jxta.id.ID id)
          Returns the trusted cert for the specified id.
(package private)  java.security.cert.X509Certificate getTrustedCertificate(net.jxta.id.ID id, char[] store_password)
          Returns the trusted cert for the specified id.
 java.security.cert.X509Certificate[] getTrustedCertificateChain(net.jxta.id.ID id)
          Returns the trusted cert chain for the specified id.
 net.jxta.id.ID getTrustedCertificateID(java.security.cert.X509Certificate cert)
          Returns the ID of the provided certificate or null if the certificate is not found in the keystore.
 net.jxta.id.ID[] getTrustedCertsList()
          Returns the list of the trusted certificates available in this keystore.
 void initialize()
          Create a new PSE enviroment.
 boolean isInitialized()
          Returns true if the PSE needs to be configured before it can be used.
 void setKey(net.jxta.id.ID id, java.security.cert.Certificate[] certchain, java.security.PrivateKey key, char[] key_password)
          Adds a key to the pse keystore.
 void setKeyStorePassword(char[] store_password)
          Sets the password to be used when unlocking the keystore.
 void setTrustedCertificate(net.jxta.id.ID id, java.security.cert.X509Certificate cert)
          Adds a trusted certificate with the specified id to the key store.
(package private)  boolean validPasswd(net.jxta.id.ID id, char[] store_password, char[] key_password)
          Check if the provided passwords are correct for the specified identity.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final transient org.apache.log4j.Logger LOG
Log4J Logger


keystore_manager

private KeyStoreManager keystore_manager
Manager for the keystore we are using.


keystore_password

private char[] keystore_password
The keystore password.

Constructor Detail

PSEConfig

public PSEConfig(KeyStoreManager storeManager,
                 char[] password)
Standard constructor.

Method Detail

setKeyStorePassword

public final void setKeyStorePassword(char[] store_password)
Sets the password to be used when unlocking the keystore.


finalize

protected void finalize()
                 throws java.lang.Throwable
null


isInitialized

public boolean isInitialized()
Returns true if the PSE needs to be configured before it can be used.


initialize

public void initialize()
                throws java.security.KeyStoreException,
                       java.io.IOException
Create a new PSE enviroment.


erase

public void erase()
           throws java.io.IOException
Remove an existing PSE enviroment.


getKeyStore

public java.security.KeyStore getKeyStore()
Gets a copy of the keystore associated with this PSE instance.


validPasswd

boolean validPasswd(net.jxta.id.ID id,
                    char[] store_password,
                    char[] key_password)
Check if the provided passwords are correct for the specified identity.


getTrustedCertsList

public net.jxta.id.ID[] getTrustedCertsList()
                                     throws java.security.KeyStoreException,
                                            java.io.IOException
Returns the list of the trusted certificates available in this keystore.


getKeysList

public net.jxta.id.ID[] getKeysList()
                             throws java.security.KeyStoreException,
                                    java.io.IOException
Returns the list of root certificates for which there is an associated local private key.


getKeysList

net.jxta.id.ID[] getKeysList(char[] store_password)
                       throws java.security.KeyStoreException,
                              java.io.IOException
Returns the list of root certificates for which there is an associated local private key.


getTrustedCertificateID

public net.jxta.id.ID getTrustedCertificateID(java.security.cert.X509Certificate cert)
                                       throws java.security.KeyStoreException,
                                              java.io.IOException
Returns the ID of the provided certificate or null if the certificate is not found in the keystore.


getTrustedCertificate

public java.security.cert.X509Certificate getTrustedCertificate(net.jxta.id.ID id)
                                                         throws java.security.KeyStoreException,
                                                                java.io.IOException
Returns the trusted cert for the specified id.


getTrustedCertificate

java.security.cert.X509Certificate getTrustedCertificate(net.jxta.id.ID id,
                                                         char[] store_password)
                                                   throws java.security.KeyStoreException,
                                                          java.io.IOException
Returns the trusted cert for the specified id.


getTrustedCertificateChain

public java.security.cert.X509Certificate[] getTrustedCertificateChain(net.jxta.id.ID id)
                                                                throws java.security.KeyStoreException,
                                                                       java.io.IOException
Returns the trusted cert chain for the specified id.


getKey

public java.security.PrivateKey getKey(net.jxta.id.ID id,
                                       char[] key_password)
                                throws java.security.KeyStoreException,
                                       java.io.IOException
Returns the private key for the specified ID.


setTrustedCertificate

public void setTrustedCertificate(net.jxta.id.ID id,
                                  java.security.cert.X509Certificate cert)
                           throws java.security.KeyStoreException,
                                  java.io.IOException
Adds a trusted certificate with the specified id to the key store.


setKey

public void setKey(net.jxta.id.ID id,
                   java.security.cert.Certificate[] certchain,
                   java.security.PrivateKey key,
                   char[] key_password)
            throws java.security.KeyStoreException,
                   java.io.IOException
Adds a key to the pse keystore. The key is stored using the provided key password.


erase

public void erase(net.jxta.id.ID id)
           throws java.security.KeyStoreException,
                  java.io.IOException
Erases the specified id from the keystore.