java.security
Class KeyStoreSpi

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.security.KeyStoreSpi

public abstract class KeyStoreSpi
extends Object sample code for java.lang.Object definition code for java.lang.Object

This class defines the Service Provider Interface (SPI) for the KeyStore class. All the abstract methods in this class must be implemented by each cryptographic service provider who wishes to supply the implementation of a keystore for a particular keystore type.

Since:
1.2
See Also:
KeyStore sample code for java.security.KeyStore definition code for java.security.KeyStore

Constructor Summary
KeyStoreSpi sample code for java.security.KeyStoreSpi.KeyStoreSpi() definition code for java.security.KeyStoreSpi.KeyStoreSpi() ()
           
 
Method Summary
abstract  Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <String sample code for java.lang.String definition code for java.lang.String > engineAliases sample code for java.security.KeyStoreSpi.engineAliases() definition code for java.security.KeyStoreSpi.engineAliases() ()
          Lists all the alias names of this keystore.
abstract  boolean engineContainsAlias sample code for java.security.KeyStoreSpi.engineContainsAlias(java.lang.String) definition code for java.security.KeyStoreSpi.engineContainsAlias(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  alias)
          Checks if the given alias exists in this keystore.
abstract  void engineDeleteEntry sample code for java.security.KeyStoreSpi.engineDeleteEntry(java.lang.String) definition code for java.security.KeyStoreSpi.engineDeleteEntry(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  alias)
          Deletes the entry identified by the given alias from this keystore.
 boolean engineEntryInstanceOf sample code for java.security.KeyStoreSpi.engineEntryInstanceOf(java.lang.String, java.lang.Class) definition code for java.security.KeyStoreSpi.engineEntryInstanceOf(java.lang.String, java.lang.Class) (String sample code for java.lang.String definition code for java.lang.String  alias, Class sample code for java.lang.Class definition code for java.lang.Class <? extends KeyStore.Entry sample code for java.security.KeyStore.Entry definition code for java.security.KeyStore.Entry > entryClass)
          Determines if the keystore Entry for the specified alias is an instance or subclass of the specified entryClass.
abstract  Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate engineGetCertificate sample code for java.security.KeyStoreSpi.engineGetCertificate(java.lang.String) definition code for java.security.KeyStoreSpi.engineGetCertificate(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  alias)
          Returns the certificate associated with the given alias.
abstract  String sample code for java.lang.String definition code for java.lang.String engineGetCertificateAlias sample code for java.security.KeyStoreSpi.engineGetCertificateAlias(java.security.cert.Certificate) definition code for java.security.KeyStoreSpi.engineGetCertificateAlias(java.security.cert.Certificate) (Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate  cert)
          Returns the (alias) name of the first keystore entry whose certificate matches the given certificate.
abstract  Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate [] engineGetCertificateChain sample code for java.security.KeyStoreSpi.engineGetCertificateChain(java.lang.String) definition code for java.security.KeyStoreSpi.engineGetCertificateChain(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  alias)
          Returns the certificate chain associated with the given alias.
abstract  Date sample code for java.util.Date definition code for java.util.Date engineGetCreationDate sample code for java.security.KeyStoreSpi.engineGetCreationDate(java.lang.String) definition code for java.security.KeyStoreSpi.engineGetCreationDate(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  alias)
          Returns the creation date of the entry identified by the given alias.
 KeyStore.Entry sample code for java.security.KeyStore.Entry definition code for java.security.KeyStore.Entry engineGetEntry sample code for java.security.KeyStoreSpi.engineGetEntry(java.lang.String, java.security.KeyStore.ProtectionParameter) definition code for java.security.KeyStoreSpi.engineGetEntry(java.lang.String, java.security.KeyStore.ProtectionParameter) (String sample code for java.lang.String definition code for java.lang.String  alias, KeyStore.ProtectionParameter sample code for java.security.KeyStore.ProtectionParameter definition code for java.security.KeyStore.ProtectionParameter  protParam)
          Gets a KeyStore.Entry for the specified alias with the specified protection parameter.
abstract  Key sample code for java.security.Key definition code for java.security.Key engineGetKey sample code for java.security.KeyStoreSpi.engineGetKey(java.lang.String, char[]) definition code for java.security.KeyStoreSpi.engineGetKey(java.lang.String, char[]) (String sample code for java.lang.String definition code for java.lang.String  alias, char[] password)
          Returns the key associated with the given alias, using the given password to recover it.
abstract  boolean engineIsCertificateEntry sample code for java.security.KeyStoreSpi.engineIsCertificateEntry(java.lang.String) definition code for java.security.KeyStoreSpi.engineIsCertificateEntry(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  alias)
          Returns true if the entry identified by the given alias was created by a call to setCertificateEntry, or created by a call to setEntry with a TrustedCertificateEntry.
abstract  boolean engineIsKeyEntry sample code for java.security.KeyStoreSpi.engineIsKeyEntry(java.lang.String) definition code for java.security.KeyStoreSpi.engineIsKeyEntry(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  alias)
          Returns true if the entry identified by the given alias was created by a call to setKeyEntry, or created by a call to setEntry with a PrivateKeyEntry or a SecretKeyEntry.
abstract  void engineLoad sample code for java.security.KeyStoreSpi.engineLoad(java.io.InputStream, char[]) definition code for java.security.KeyStoreSpi.engineLoad(java.io.InputStream, char[]) (InputStream sample code for java.io.InputStream definition code for java.io.InputStream  stream, char[] password)
          Loads the keystore from the given input stream.
 void engineLoad sample code for java.security.KeyStoreSpi.engineLoad(java.security.KeyStore.LoadStoreParameter) definition code for java.security.KeyStoreSpi.engineLoad(java.security.KeyStore.LoadStoreParameter) (KeyStore.LoadStoreParameter sample code for java.security.KeyStore.LoadStoreParameter definition code for java.security.KeyStore.LoadStoreParameter  param)
          Loads the keystore using the given KeyStore.LoadStoreParameter.
abstract  void engineSetCertificateEntry sample code for java.security.KeyStoreSpi.engineSetCertificateEntry(java.lang.String, java.security.cert.Certificate) definition code for java.security.KeyStoreSpi.engineSetCertificateEntry(java.lang.String, java.security.cert.Certificate) (String sample code for java.lang.String definition code for java.lang.String  alias, Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate  cert)
          Assigns the given certificate to the given alias.
 void engineSetEntry sample code for java.security.KeyStoreSpi.engineSetEntry(java.lang.String, java.security.KeyStore.Entry, java.security.KeyStore.ProtectionParameter) definition code for java.security.KeyStoreSpi.engineSetEntry(java.lang.String, java.security.KeyStore.Entry, java.security.KeyStore.ProtectionParameter) (String sample code for java.lang.String definition code for java.lang.String  alias, KeyStore.Entry sample code for java.security.KeyStore.Entry definition code for java.security.KeyStore.Entry  entry, KeyStore.ProtectionParameter sample code for java.security.KeyStore.ProtectionParameter definition code for java.security.KeyStore.ProtectionParameter  protParam)
          Saves a KeyStore.Entry under the specified alias.
abstract  void engineSetKeyEntry sample code for java.security.KeyStoreSpi.engineSetKeyEntry(java.lang.String, byte[], java.security.cert.Certificate[]) definition code for java.security.KeyStoreSpi.engineSetKeyEntry(java.lang.String, byte[], java.security.cert.Certificate[]) (String sample code for java.lang.String definition code for java.lang.String  alias, byte[] key, Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate [] chain)
          Assigns the given key (that has already been protected) to the given alias.
abstract  void engineSetKeyEntry sample code for java.security.KeyStoreSpi.engineSetKeyEntry(java.lang.String, java.security.Key, char[], java.security.cert.Certificate[]) definition code for java.security.KeyStoreSpi.engineSetKeyEntry(java.lang.String, java.security.Key, char[], java.security.cert.Certificate[]) (String sample code for java.lang.String definition code for java.lang.String  alias, Key sample code for java.security.Key definition code for java.security.Key  key, char[] password, Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate [] chain)
          Assigns the given key to the given alias, protecting it with the given password.
abstract  int engineSize sample code for java.security.KeyStoreSpi.engineSize() definition code for java.security.KeyStoreSpi.engineSize() ()
          Retrieves the number of entries in this keystore.
 void engineStore sample code for java.security.KeyStoreSpi.engineStore(java.security.KeyStore.LoadStoreParameter) definition code for java.security.KeyStoreSpi.engineStore(java.security.KeyStore.LoadStoreParameter) (KeyStore.LoadStoreParameter sample code for java.security.KeyStore.LoadStoreParameter definition code for java.security.KeyStore.LoadStoreParameter  param)
          Stores this keystore using the given KeyStore.LoadStoreParmeter.
abstract  void engineStore sample code for java.security.KeyStoreSpi.engineStore(java.io.OutputStream, char[]) definition code for java.security.KeyStoreSpi.engineStore(java.io.OutputStream, char[]) (OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  stream, char[] password)
          Stores this keystore to the given output stream, and protects its integrity with the given password.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

KeyStoreSpi sample code for java.security.KeyStoreSpi() definition code for java.security.KeyStoreSpi()

public KeyStoreSpi()
Method Detail

engineGetKey sample code for java.security.KeyStoreSpi.engineGetKey(java.lang.String, char[]) definition code for java.security.KeyStoreSpi.engineGetKey(java.lang.String, char[])

public abstract Key sample code for java.security.Key definition code for java.security.Key  engineGetKey(String sample code for java.lang.String definition code for java.lang.String  alias,
                                 char[] password)
                          throws NoSuchAlgorithmException sample code for java.security.NoSuchAlgorithmException definition code for java.security.NoSuchAlgorithmException ,
                                 UnrecoverableKeyException sample code for java.security.UnrecoverableKeyException definition code for java.security.UnrecoverableKeyException 
Returns the key associated with the given alias, using the given password to recover it. The key must have been associated with the alias by a call to setKeyEntry, or by a call to setEntry with a PrivateKeyEntry or SecretKeyEntry.

Parameters:
alias - the alias name
password - the password for recovering the key
Returns:
the requested key, or null if the given alias does not exist or does not identify a key-related entry.
Throws:
NoSuchAlgorithmException sample code for java.security.NoSuchAlgorithmException definition code for java.security.NoSuchAlgorithmException - if the algorithm for recovering the key cannot be found
UnrecoverableKeyException sample code for java.security.UnrecoverableKeyException definition code for java.security.UnrecoverableKeyException - if the key cannot be recovered (e.g., the given password is wrong).

engineGetCertificateChain sample code for java.security.KeyStoreSpi.engineGetCertificateChain(java.lang.String) definition code for java.security.KeyStoreSpi.engineGetCertificateChain(java.lang.String)

public abstract Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate [] engineGetCertificateChain(String sample code for java.lang.String definition code for java.lang.String  alias)
Returns the certificate chain associated with the given alias. The certificate chain must have been associated with the alias by a call to setKeyEntry, or by a call to setEntry with a PrivateKeyEntry.

Parameters:
alias - the alias name
Returns:
the certificate chain (ordered with the user's certificate first and the root certificate authority last), or null if the given alias does not exist or does not contain a certificate chain

engineGetCertificate sample code for java.security.KeyStoreSpi.engineGetCertificate(java.lang.String) definition code for java.security.KeyStoreSpi.engineGetCertificate(java.lang.String)

public abstract Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate  engineGetCertificate(String sample code for java.lang.String definition code for java.lang.String  alias)
Returns the certificate associated with the given alias.

If the given alias name identifies an entry created by a call to setCertificateEntry, or created by a call to setEntry with a TrustedCertificateEntry, then the trusted certificate contained in that entry is returned.

If the given alias name identifies an entry created by a call to setKeyEntry, or created by a call to setEntry with a PrivateKeyEntry, then the first element of the certificate chain in that entry (if a chain exists) is returned.

Parameters:
alias - the alias name
Returns:
the certificate, or null if the given alias does not exist or does not contain a certificate.

engineGetCreationDate sample code for java.security.KeyStoreSpi.engineGetCreationDate(java.lang.String) definition code for java.security.KeyStoreSpi.engineGetCreationDate(java.lang.String)

public abstract Date sample code for java.util.Date definition code for java.util.Date  engineGetCreationDate(String sample code for java.lang.String definition code for java.lang.String  alias)
Returns the creation date of the entry identified by the given alias.

Parameters:
alias - the alias name
Returns:
the creation date of this entry, or null if the given alias does not exist

engineSetKeyEntry sample code for java.security.KeyStoreSpi.engineSetKeyEntry(java.lang.String, java.security.Key, char[], java.security.cert.Certificate[]) definition code for java.security.KeyStoreSpi.engineSetKeyEntry(java.lang.String, java.security.Key, char[], java.security.cert.Certificate[])

public abstract void engineSetKeyEntry(String sample code for java.lang.String definition code for java.lang.String  alias,
                                       Key sample code for java.security.Key definition code for java.security.Key  key,
                                       char[] password,
                                       Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate [] chain)
                                throws KeyStoreException sample code for java.security.KeyStoreException definition code for java.security.KeyStoreException 
Assigns the given key to the given alias, protecting it with the given password.

If the given key is of type java.security.PrivateKey, it must be accompanied by a certificate chain certifying the corresponding public key.

If the given alias already exists, the keystore information associated with it is overridden by the given key (and possibly certificate chain).

Parameters:
alias - the alias name
key - the key to be associated with the alias
password - the password to protect the key
chain - the certificate chain for the corresponding public key (only required if the given key is of type java.security.PrivateKey).
Throws:
KeyStoreException sample code for java.security.KeyStoreException definition code for java.security.KeyStoreException - if the given key cannot be protected, or this operation fails for some other reason

engineSetKeyEntry sample code for java.security.KeyStoreSpi.engineSetKeyEntry(java.lang.String, byte[], java.security.cert.Certificate[]) definition code for java.security.KeyStoreSpi.engineSetKeyEntry(java.lang.String, byte[], java.security.cert.Certificate[])

public abstract void engineSetKeyEntry(String sample code for java.lang.String definition code for java.lang.String  alias,
                                       byte[] key,
                                       Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate [] chain)
                                throws KeyStoreException sample code for java.security.KeyStoreException definition code for java.security.KeyStoreException 
Assigns the given key (that has already been protected) to the given alias.

If the protected key is of type java.security.PrivateKey, it must be accompanied by a certificate chain certifying the corresponding public key.

If the given alias already exists, the keystore information associated with it is overridden by the given key (and possibly certificate chain).

Parameters:
alias - the alias name
key - the key (in protected format) to be associated with the alias
chain - the certificate chain for the corresponding public key (only useful if the protected key is of type java.security.PrivateKey).
Throws:
KeyStoreException sample code for java.security.KeyStoreException definition code for java.security.KeyStoreException - if this operation fails.

engineSetCertificateEntry sample code for java.security.KeyStoreSpi.engineSetCertificateEntry(java.lang.String, java.security.cert.Certificate) definition code for java.security.KeyStoreSpi.engineSetCertificateEntry(java.lang.String, java.security.cert.Certificate)

public abstract void engineSetCertificateEntry(String sample code for java.lang.String definition code for java.lang.String  alias,
                                               Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate  cert)
                                        throws KeyStoreException sample code for java.security.KeyStoreException definition code for java.security.KeyStoreException 
Assigns the given certificate to the given alias.

If the given alias identifies an existing entry created by a call to setCertificateEntry, or created by a call to setEntry with a TrustedCertificateEntry, the trusted certificate in the existing entry is overridden by the given certificate.

Parameters:
alias - the alias name
cert - the certificate
Throws:
KeyStoreException sample code for java.security.KeyStoreException definition code for java.security.KeyStoreException - if the given alias already exists and does not identify an entry containing a trusted certificate, or this operation fails for some other reason.

engineDeleteEntry sample code for java.security.KeyStoreSpi.engineDeleteEntry(java.lang.String) definition code for java.security.KeyStoreSpi.engineDeleteEntry(java.lang.String)

public abstract void engineDeleteEntry(String sample code for java.lang.String definition code for java.lang.String  alias)
                                throws KeyStoreException sample code for java.security.KeyStoreException definition code for java.security.KeyStoreException 
Deletes the entry identified by the given alias from this keystore.

Parameters:
alias - the alias name
Throws:
KeyStoreException sample code for java.security.KeyStoreException definition code for java.security.KeyStoreException - if the entry cannot be removed.

engineAliases sample code for java.security.KeyStoreSpi.engineAliases() definition code for java.security.KeyStoreSpi.engineAliases()

public abstract Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <String sample code for java.lang.String definition code for java.lang.String > engineAliases()
Lists all the alias names of this keystore.

Returns:
enumeration of the alias names

engineContainsAlias sample code for java.security.KeyStoreSpi.engineContainsAlias(java.lang.String) definition code for java.security.KeyStoreSpi.engineContainsAlias(java.lang.String)

public abstract boolean engineContainsAlias(String sample code for java.lang.String definition code for java.lang.String  alias)
Checks if the given alias exists in this keystore.

Parameters:
alias - the alias name
Returns:
true if the alias exists, false otherwise

engineSize sample code for java.security.KeyStoreSpi.engineSize() definition code for java.security.KeyStoreSpi.engineSize()

public abstract int engineSize()
Retrieves the number of entries in this keystore.

Returns:
the number of entries in this keystore

engineIsKeyEntry sample code for java.security.KeyStoreSpi.engineIsKeyEntry(java.lang.String) definition code for java.security.KeyStoreSpi.engineIsKeyEntry(java.lang.String)

public abstract boolean engineIsKeyEntry(String sample code for java.lang.String definition code for java.lang.String  alias)
Returns true if the entry identified by the given alias was created by a call to setKeyEntry, or created by a call to setEntry with a PrivateKeyEntry or a SecretKeyEntry.

Parameters:
alias - the alias for the keystore entry to be checked
Returns:
true if the entry identified by the given alias is a key-related, false otherwise.

engineIsCertificateEntry sample code for java.security.KeyStoreSpi.engineIsCertificateEntry(java.lang.String) definition code for java.security.KeyStoreSpi.engineIsCertificateEntry(java.lang.String)

public abstract boolean engineIsCertificateEntry(String sample code for java.lang.String definition code for java.lang.String  alias)
Returns true if the entry identified by the given alias was created by a call to setCertificateEntry, or created by a call to setEntry with a TrustedCertificateEntry.

Parameters:
alias - the alias for the keystore entry to be checked
Returns:
true if the entry identified by the given alias contains a trusted certificate, false otherwise.

engineGetCertificateAlias sample code for java.security.KeyStoreSpi.engineGetCertificateAlias(java.security.cert.Certificate) definition code for java.security.KeyStoreSpi.engineGetCertificateAlias(java.security.cert.Certificate)

public abstract String sample code for java.lang.String definition code for java.lang.String  engineGetCertificateAlias(Certificate sample code for java.security.cert.Certificate definition code for java.security.cert.Certificate  cert)
Returns the (alias) name of the first keystore entry whose certificate matches the given certificate.

This method attempts to match the given certificate with each keystore entry. If the entry being considered was created by a call to setCertificateEntry, or created by a call to setEntry with a TrustedCertificateEntry, then the given certificate is compared to that entry's certificate.

If the entry being considered was created by a call to setKeyEntry, or created by a call to setEntry with a PrivateKeyEntry, then the given certificate is compared to the first element of that entry's certificate chain.

Parameters:
cert - the certificate to match with.
Returns:
the alias name of the first entry with matching certificate, or null if no such entry exists in this keystore.

engineStore sample code for java.security.KeyStoreSpi.engineStore(java.io.OutputStream, char[]) definition code for java.security.KeyStoreSpi.engineStore(java.io.OutputStream, char[])

public abstract void engineStore(OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  stream,
                                 char[] password)
                          throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                                 NoSuchAlgorithmException sample code for java.security.NoSuchAlgorithmException definition code for java.security.NoSuchAlgorithmException ,
                                 CertificateException sample code for java.security.cert.CertificateException definition code for java.security.cert.CertificateException 
Stores this keystore to the given output stream, and protects its integrity with the given password.

Parameters:
stream - the output stream to which this keystore is written.
password - the password to generate the keystore integrity check
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if there was an I/O problem with data
NoSuchAlgorithmException sample code for java.security.NoSuchAlgorithmException definition code for java.security.NoSuchAlgorithmException - if the appropriate data integrity algorithm could not be found
CertificateException sample code for java.security.cert.CertificateException definition code for java.security.cert.CertificateException - if any of the certificates included in the keystore data could not be stored

engineStore sample code for java.security.KeyStoreSpi.engineStore(java.security.KeyStore.LoadStoreParameter) definition code for java.security.KeyStoreSpi.engineStore(java.security.KeyStore.LoadStoreParameter)

public void engineStore(KeyStore.LoadStoreParameter sample code for java.security.KeyStore.LoadStoreParameter definition code for java.security.KeyStore.LoadStoreParameter  param)
                 throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                        NoSuchAlgorithmException sample code for java.security.NoSuchAlgorithmException definition code for java.security.NoSuchAlgorithmException ,
                        CertificateException sample code for java.security.cert.CertificateException definition code for java.security.cert.CertificateException 
Stores this keystore using the given KeyStore.LoadStoreParmeter.

Parameters:
param - the KeyStore.LoadStoreParmeter that specifies how to store the keystore, which may be null
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the given KeyStore.LoadStoreParmeter input is not recognized
IOException sample code for java.io.IOException definition code for java.io.IOException - if there was an I/O problem with data
NoSuchAlgorithmException sample code for java.security.NoSuchAlgorithmException definition code for java.security.NoSuchAlgorithmException - if the appropriate data integrity algorithm could not be found
CertificateException sample code for java.security.cert.CertificateException definition code for java.security.cert.CertificateException - if any of the certificates included in the keystore data could not be stored
Since:
1.5

engineLoad sample code for java.security.KeyStoreSpi.engineLoad(java.io.InputStream, char[]) definition code for java.security.KeyStoreSpi.engineLoad(java.io.InputStream, char[])

public abstract void engineLoad(InputStream sample code for java.io.InputStream definition code for java.io.InputStream  stream,
                                char[] password)
                         throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                                NoSuchAlgorithmException sample code for java.security.NoSuchAlgorithmException definition code for java.security.NoSuchAlgorithmException ,
                                CertificateException sample code for java.security.cert.CertificateException definition code for java.security.cert.CertificateException 
Loads the keystore from the given input stream.

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.

Parameters:
stream - the input stream from which the keystore is loaded, or null
password - the password used to check the integrity of the keystore, the password used to unlock the keystore, or null
Throws:
IOException sample code for java.io.IOException definition code for java.io.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
NoSuchAlgorithmException sample code for java.security.NoSuchAlgorithmException definition code for java.security.NoSuchAlgorithmException - if the algorithm used to check the integrity of the keystore cannot be found
CertificateException sample code for java.security.cert.CertificateException definition code for java.security.cert.CertificateException - if any of the certificates in the keystore could not be loaded

engineLoad sample code for java.security.KeyStoreSpi.engineLoad(java.security.KeyStore.LoadStoreParameter) definition code for java.security.KeyStoreSpi.engineLoad(java.security.KeyStore.LoadStoreParameter)

public void engineLoad(KeyStore.LoadStoreParameter sample code for java.security.KeyStore.LoadStoreParameter definition code for java.security.KeyStore.LoadStoreParameter  param)
                throws IOException sample code for java.io.IOException definition code for java.io.IOException ,
                       NoSuchAlgorithmException sample code for java.security.NoSuchAlgorithmException definition code for java.security.NoSuchAlgorithmException ,
                       CertificateException sample code for java.security.cert.CertificateException definition code for java.security.cert.CertificateException 
Loads the keystore using the given KeyStore.LoadStoreParameter.

Note that if this KeyStore has already been loaded, it is reinitialized and loaded again from the given parameter.

Parameters:
param - the KeyStore.LoadStoreParameter that specifies how to load the keystore, which may be null
Throws:
IllegalArgumentException