|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sun.jini.config.KeyStores
Provides static methods for manipulating instances of KeyStore
conveniently from within the source of a Configuration. This class
cannot be instantiated.
| Method Summary | |
static KeyStore |
getKeyStore(String location,
String type)
Returns a KeyStore initialized with contents read from a
location specified as a file or URL. |
static X500Principal |
getX500Principal(String alias,
KeyStore keystore)
Returns the X500Principal for the alias in a
KeyStore; or null if the alias is not found,
if the alias is not associated with a certificate, or if the certificate
is not an X509Certificate. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static KeyStore getKeyStore(String location,
String type)
throws GeneralSecurityException,
IOException
KeyStore initialized with contents read from a
location specified as a file or URL. This method provides a convenient
way to refer to keystores from within the source for a configuration,
which may then be used with getX500Principal
to refer to principals.
For example, a deployer that was using SslServerEndpoint might
use the following in the source for a ConfigurationFile to
supply principals for use in security constraints:
Client {
private static users = KeyStores.getKeyStore("users.ks", null);
private static client = KeyStores.getX500Principal("client", users);
//...
}
location - the file name or URL containing the
KeyStore contentstype - the type of KeyStore to create, or
null for the default type
KeyStore, with contents read from
location
GeneralSecurityException - if there are problems with the contents
IOException - if an I/O error occurs when reading from
location
NullPointerException - if location is
nullgetX500Principal
public static X500Principal getX500Principal(String alias,
KeyStore keystore)
throws KeyStoreException
X500Principal for the alias in a
KeyStore; or null if the alias is not found,
if the alias is not associated with a certificate, or if the certificate
is not an X509Certificate. This method provides a convenient way
to refer to principals from within the source for a configuration by
specifying aliases when used with getKeystore.
For example, a deployer that was using SslServerEndpoint might
use the following in the source for a ConfigurationFile to
supply principals for use in security constraints:
Client {
private static users = KeyStores.getKeyStore("users.ks", null);
private static client = KeyStores.getX500Principal("client", users);
//...
}
alias - the aliaskeystore - the KeyStore
X500Principal or null
KeyStoreException - if the keystore has not been initialized
(loaded)
NullPointerException - if either argument is nullgetKeyStore
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||