org.dvb.security
Class KeyStoreBuilder

java.lang.Object
  extended by org.dvb.security.KeyStoreBuilder

public abstract class KeyStoreBuilder
extends java.lang.Object

An instance of this class encapsulates the information needed to instance and initialize a KeyStore object. That process is triggered when the getKeyStore method is called. This makes it possible to decouple configuration from KeyStore object creation and delay password prompt until it is needed.


Method Summary
abstract  java.security.KeyStore getKeyStore()
          Returns the KeyStore described by this object.
static KeyStoreBuilder newInstance(java.lang.String type, java.security.Provider provider, KeyStoreProtectionParameters protection)
          Returns a new builder object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getKeyStore

public abstract java.security.KeyStore getKeyStore()
                                            throws KeyStoreException
Returns the KeyStore described by this object.

Throws:
KeyStoreException - if an error occurred, e.g. if an error occurred in the constructor or the load method of the KeyStore

newInstance

public static KeyStoreBuilder newInstance(java.lang.String type,
                                          java.security.Provider provider,
                                          KeyStoreProtectionParameters protection)
Returns a new builder object. Each call to the getKeyStore method on the returned builder will return a new org.dvb.security.DVBKeyStore object of type type. Its load method is invoked with the protection parameter used to construct this KeyStoreBuilder.

Parameters:
type - the type of the KeyStore to be constructed. The type parameter is concatenated with the string "KeyStore." and then passed to the get method of the specified Provider in order to obtain the fully qualified name of the KeyStoreSpi implementation. For more details, see "How to Implement a Provider for the JavaTM Cryptography Architecture"
provider - the provider from which the keyStore is to be instantiated.
protection - the protection parameter securing the Keystore.
Throws:
java.lang.IllegalArgumentException - if protection is an application defined class
java.lang.NullPointerException - if type, provider or protection are null