KeyStore.Builder (Java Platform SE 8 ) (original) (raw)

Returns a new Builder object.

The first call to the getKeyStore() method on the returned builder will create a KeyStore of type type and call its load() method. The inputStream argument is constructed fromfile. If protection is aPasswordProtection, the password is obtained by calling the getPassword method. Otherwise, if protection is aCallbackHandlerProtection, the password is obtained by invoking the CallbackHandler.

Subsequent calls to getKeyStore() return the same object as the initial call. If the initial call to failed with a KeyStoreException, subsequent calls also throw a KeyStoreException.

The KeyStore is instantiated from provider if non-null. Otherwise, all installed providers are searched.

Calls to getProtectionParameter() will return a PasswordProtection object encapsulating the password that was used to invoke theload method.

Note that the getKeyStore() method is executed within the AccessControlContext of the code invoking this method.