public final void load(InputStream stream, char[] password)
        throws IOException, NoSuchAlgorithmException, CertificateException
    {
        keyStoreSpi.engineLoad(stream, password);
        initialized = true;
    }
public final void load ( InputStream stream , char [ ] password ) throws IOException , NoSuchAlgorithmException , CertificateException { keyStoreSpi . engineLoad ( stream , password ) ; initialized = true ; }
Loads this KeyStore from the given input stream.

<p>A password may be given to unlock the keystore
(e.g. the keystore resides on a hardware token device),
or to check the integrity of the keystore data.
If a password is not given for integrity checking,
then integrity checking is not performed.

<p>In order to create an empty keystore, or if the keystore cannot
be initialized from a stream, pass <code>null</code>
as the <code>stream</code> argument.

<p> Note that if this keystore has already been loaded, it is
reinitialized and loaded again from the given input stream.

@param stream the input stream from which the keystore is loaded,
or <code>null</code>
@param password the password used to check the integrity of
the keystore, the password used to unlock the keystore,
or <code>null</code>

@exception IOException if there is an I/O or format problem with the
keystore data, if a password is required but not given,
or if the given password was incorrect. If the error is due to a
wrong password, the {@link Throwable#getCause cause} of the
<code>IOException</code> should be an
<code>UnrecoverableKeyException</code>
@exception NoSuchAlgorithmException if the algorithm used to check
the integrity of the keystore cannot be found
@exception CertificateException if any of the certificates in the
keystore could not be loaded