|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.membership.pse.PSEConfig
public final class PSEConfig
Manages the state of a Personal Security Enviroment.
Constructor Summary | |
---|---|
PSEConfig(KeyStoreManager storeManager,
char[] store_password)
Standard constructor. |
Method Summary | |
---|---|
void |
erase()
Removes an existing PSE enviroment. |
void |
erase(ID id)
Erases the specified id from the keystore. |
protected void |
finalize()
|
PrivateKey |
getKey(ID id,
char[] key_password)
Returns the private key for the specified ID. |
ID[] |
getKeysList()
Returns the list of root certificates for which there is an associated local private key. |
(package private) ID[] |
getKeysList(char[] store_password)
Returns the list of root certificates for which there is an associated local private key. |
KeyStore |
getKeyStore()
Gets a copy of the KeyStore associated with this PSE instance. |
KeyStore |
getKeyStore(char[] store_password)
Gets a copy of the KeyStore associated with this PSE instance. |
X509Certificate |
getTrustedCertificate(ID id)
Returns the trusted cert for the specified id. |
(package private) X509Certificate |
getTrustedCertificate(ID id,
char[] store_password)
Returns the trusted cert for the specified id. |
X509Certificate[] |
getTrustedCertificateChain(ID id)
Returns the trusted cert chain for the specified id. |
ID |
getTrustedCertificateID(X509Certificate cert)
Returns the ID of the provided certificate or null if the certificate is not found in the keystore. |
ID[] |
getTrustedCertsList()
Returns the list of the trusted certificates available in this keystore. |
void |
initialize()
Initializes the PSE environment. |
boolean |
isInitialized()
Returns true if the PSE has been initialized (created). |
boolean |
isKey(ID id)
Returns true if the specified id is associated with a private key. |
boolean |
isKey(ID id,
char[] store_password)
Returns true if the specified id is associated with a private key. |
void |
setKey(ID id,
Certificate[] certchain,
PrivateKey key,
char[] key_password)
Adds a private key to the PSE using the specified ID. |
void |
setKeyStorePassword(char[] store_password)
Sets the passphrase to be used when unlocking the keystore. |
void |
setTrustedCertificate(ID id,
X509Certificate cert)
Adds a trusted certificate with the specified id to the key store. |
(package private) boolean |
validPasswd(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 |
Constructor Detail |
---|
PSEConfig(KeyStoreManager storeManager, char[] store_password)
storeManager
- The StoreManager to be used for this PSEConfig
instance.store_password
- The passphrase for the keystore or null.
The passphrase may be set independantly via
setKeyStorePassword(char[])
.Method Detail |
---|
public final void setKeyStorePassword(char[] store_password)
store_password
- The passphrase used to unlock the keystore may be
null
for keystores with no passphrase.protected void finalize() throws Throwable
finalize
in class Object
Throwable
public boolean isInitialized()
true
if the PSE has been initialized (created). Some
keystore formats may not require initialization and may always return
true
. false
may also be returned if the keystore passphrase is
incorrect.
true
if the PSE has been previously initialized
otherwise false
.public void initialize() throws KeyStoreException, IOException
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.public void erase() throws IOException
IOException
- If the PSE cannot be successfully deleted.public KeyStore getKeyStore()
null
if it cannot be retrieved.public KeyStore getKeyStore(char[] store_password) throws KeyStoreException, IOException
store_password
- The passphrase used to unlock the keystore may be
null
for keystores with no passphrase.
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.boolean validPasswd(ID id, char[] store_password, char[] key_password)
id
- The identity to be validated.store_password
- The passphrase used to unlock the keystore may be
null
for keystores with no passphrase.key_password
- The passphrase associated with the private key or
null
if the key has no passphrase.
true
if the passwords were valid for the given id
otherwise false
.public ID[] getTrustedCertsList() throws KeyStoreException, IOException
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.public ID[] getKeysList() throws KeyStoreException, IOException
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.ID[] getKeysList(char[] store_password) throws KeyStoreException, IOException
store_password
- The passphrase used to unlock the keystore may be
null
for keystores with no passphrase.
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.public ID getTrustedCertificateID(X509Certificate cert) throws KeyStoreException, IOException
cert
- The certificate who's ID is desired.
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.public X509Certificate getTrustedCertificate(ID id) throws KeyStoreException, IOException
id
- The id of the Certificate to retrieve.
KeyStoreException
- When the wrong keystore key has been provided.
IOException
- For errors related to processing the keystore.X509Certificate getTrustedCertificate(ID id, char[] store_password) throws KeyStoreException, IOException
id
- The id of the Certificate to retrieve.store_password
- The passphrase used to unlock the keystore may be
null
for keystores with no passphrase.
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.public X509Certificate[] getTrustedCertificateChain(ID id) throws KeyStoreException, IOException
id
- The ID of the certificate who's certificate chain is desired.
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.public PrivateKey getKey(ID id, char[] key_password) throws KeyStoreException, IOException
id
- The ID of the requested private key.key_password
- The passphrase associated with the private key or
null
if the key has no passphrase.
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.public boolean isKey(ID id) throws KeyStoreException, IOException
id
- The ID of the requested private key.
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.public boolean isKey(ID id, char[] store_password) throws KeyStoreException, IOException
id
- The ID of the requested private key.store_password
- The passphrase used to unlock the keystore may be
null
for keystores with no passphrase.
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.public void setTrustedCertificate(ID id, X509Certificate cert) throws KeyStoreException, IOException
id
- The ID under which the certificate will be stored.cert
- Certificate for the specified ID.
KeyStoreException
- When the wrong keystore has been provided.
IOException
- For errors related to processing the keystore.public void setKey(ID id, Certificate[] certchain, PrivateKey key, char[] key_password) throws KeyStoreException, IOException
id
- The ID under which the certificate chain and private key will be stored.certchain
- The certificate chain matching the private key.key
- The private key to be stored in the kestore.key_password
- The passphrase associated with the private key or
null
if the key has no passphrase.
KeyStoreException
- When the wrong keystore key has been provided.
IOException
- For errors related to processing the keystore.public void erase(ID id) throws KeyStoreException, IOException
id
- The ID of the key or certificate to be deleted.
KeyStoreException
- When the wrong keystore password has been
provided.
IOException
- For errors related to processing the keystore.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |