Java Doc for KeyStoreSpi.java in  » 6.0-JDK-Core » security » java » security » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » security » java.security 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.security.KeyStoreSpi

KeyStoreSpi
abstract public class KeyStoreSpi (Code)
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.
author:
   Jan Luehe
version:
   1.28, 05/05/07
See Also:   KeyStore
since:
   1.2




Method Summary
abstract public  Enumeration<String>engineAliases()
     Lists all the alias names of this keystore.
abstract public  booleanengineContainsAlias(String alias)
     Checks if the given alias exists in this keystore.
abstract public  voidengineDeleteEntry(String alias)
     Deletes the entry identified by the given alias from this keystore.
public  booleanengineEntryInstanceOf(String alias, Class<? extends KeyStore.Entry> entryClass)
     Determines if the keystore Entry for the specified alias is an instance or subclass of the specified entryClass.
abstract public  CertificateengineGetCertificate(String alias)
     Returns the certificate associated with the given alias.
abstract public  StringengineGetCertificateAlias(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.

abstract public  Certificate[]engineGetCertificateChain(String alias)
     Returns the certificate chain associated with the given alias.
abstract public  DateengineGetCreationDate(String alias)
     Returns the creation date of the entry identified by the given alias.
public  KeyStore.EntryengineGetEntry(String alias, KeyStore.ProtectionParameter protParam)
     Gets a KeyStore.Entry for the specified alias with the specified protection parameter.
Parameters:
  alias - get the KeyStore.Entry for this alias
Parameters:
  protParam - the ProtectionParameterused to protect the Entry,which may be null the KeyStore.Entry for the specified alias,or null if there is no such entry
exception:
  KeyStoreException - if the operation failed
exception:
  NoSuchAlgorithmException - if the algorithm for recovering theentry cannot be found
exception:
  UnrecoverableEntryException - if the specifiedprotParam were insufficient or invalid
exception:
  UnrecoverableKeyException - if the entry is a PrivateKeyEntry or SecretKeyEntryand the specified protParam does not containthe information needed to recover the key (e.g.
abstract public  KeyengineGetKey(String alias, char[] password)
     Returns the key associated with the given alias, using the given password to recover it.
abstract public  booleanengineIsCertificateEntry(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 public  booleanengineIsKeyEntry(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 public  voidengineLoad(InputStream stream, char[] password)
     Loads the keystore from the given input stream.

A password may be given to unlock the keystore (e.g.

public  voidengineLoad(KeyStore.LoadStoreParameter param)
     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.LoadStoreParameterthat specifies how to load the keystore,which may be null
exception:
  IllegalArgumentException - if the givenKeyStore.LoadStoreParameterinput is not recognized
exception:
  IOException - if there is an I/O or format problem with thekeystore data.

abstract public  voidengineSetCertificateEntry(String alias, Certificate cert)
     Assigns the given certificate to the given alias.
public  voidengineSetEntry(String alias, KeyStore.Entry entry, KeyStore.ProtectionParameter protParam)
     Saves a KeyStore.Entry under the specified alias.
abstract public  voidengineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain)
     Assigns the given key to the given alias, protecting it with the given password.
abstract public  voidengineSetKeyEntry(String alias, byte[] key, Certificate[] chain)
     Assigns the given key (that has already been protected) to the given alias.
abstract public  intengineSize()
     Retrieves the number of entries in this keystore.
abstract public  voidengineStore(OutputStream stream, char[] password)
     Stores this keystore to the given output stream, and protects its integrity with the given password.
public  voidengineStore(KeyStore.LoadStoreParameter param)
     Stores this keystore using the given KeyStore.LoadStoreParmeter.



Method Detail
engineAliases
abstract public Enumeration<String> engineAliases()(Code)
Lists all the alias names of this keystore. enumeration of the alias names



engineContainsAlias
abstract public boolean engineContainsAlias(String alias)(Code)
Checks if the given alias exists in this keystore.
Parameters:
  alias - the alias name true if the alias exists, false otherwise



engineDeleteEntry
abstract public void engineDeleteEntry(String alias) throws KeyStoreException(Code)
Deletes the entry identified by the given alias from this keystore.
Parameters:
  alias - the alias name
exception:
  KeyStoreException - if the entry cannot be removed.



engineEntryInstanceOf
public boolean engineEntryInstanceOf(String alias, Class<? extends KeyStore.Entry> entryClass)(Code)
Determines if the keystore Entry for the specified alias is an instance or subclass of the specified entryClass.
Parameters:
  alias - the alias name
Parameters:
  entryClass - the entry class true if the keystore Entry for the specifiedalias is an instance or subclass of thespecified entryClass, false otherwise
since:
   1.5



engineGetCertificate
abstract public Certificate engineGetCertificate(String alias)(Code)
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 the certificate, or null if the given alias does not exist ordoes not contain a certificate.




engineGetCertificateAlias
abstract public String engineGetCertificateAlias(Certificate cert)(Code)
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. the alias name of the first entry with matching certificate,or null if no such entry exists in this keystore.




engineGetCertificateChain
abstract public Certificate[] engineGetCertificateChain(String alias)(Code)
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 the certificate chain (ordered with the user's certificate firstand the root certificate authority last), or null if the given aliasdoes not exist or does not contain a certificate chain



engineGetCreationDate
abstract public Date engineGetCreationDate(String alias)(Code)
Returns the creation date of the entry identified by the given alias.
Parameters:
  alias - the alias name the creation date of this entry, or null if the given alias doesnot exist



engineGetEntry
public KeyStore.Entry engineGetEntry(String alias, KeyStore.ProtectionParameter protParam) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException(Code)
Gets a KeyStore.Entry for the specified alias with the specified protection parameter.
Parameters:
  alias - get the KeyStore.Entry for this alias
Parameters:
  protParam - the ProtectionParameterused to protect the Entry,which may be null the KeyStore.Entry for the specified alias,or null if there is no such entry
exception:
  KeyStoreException - if the operation failed
exception:
  NoSuchAlgorithmException - if the algorithm for recovering theentry cannot be found
exception:
  UnrecoverableEntryException - if the specifiedprotParam were insufficient or invalid
exception:
  UnrecoverableKeyException - if the entry is a PrivateKeyEntry or SecretKeyEntryand the specified protParam does not containthe information needed to recover the key (e.g. wrong password)
since:
   1.5



engineGetKey
abstract public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException(Code)
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
Parameters:
  password - the password for recovering the key the requested key, or null if the given alias does not existor does not identify a key-related entry.
exception:
  NoSuchAlgorithmException - if the algorithm for recovering thekey cannot be found
exception:
  UnrecoverableKeyException - if the key cannot be recovered(e.g., the given password is wrong).



engineIsCertificateEntry
abstract public boolean engineIsCertificateEntry(String alias)(Code)
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 true if the entry identified by the given alias contains atrusted certificate, false otherwise.



engineIsKeyEntry
abstract public boolean engineIsKeyEntry(String alias)(Code)
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 true if the entry identified by the given alias is akey-related, false otherwise.



engineLoad
abstract public void engineLoad(InputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException(Code)
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
Parameters:
  password - the password used to check the integrity ofthe keystore, the password used to unlock the keystore,or null
exception:
  IOException - if there is an I/O or format problem with thekeystore data, if a password is required but not given,or if the given password was incorrect. If the error is due to awrong password, the Throwable.getCause cause of the IOException should be an UnrecoverableKeyException
exception:
  NoSuchAlgorithmException - if the algorithm used to checkthe integrity of the keystore cannot be found
exception:
  CertificateException - if any of the certificates in thekeystore could not be loaded




engineLoad
public void engineLoad(KeyStore.LoadStoreParameter param) throws IOException, NoSuchAlgorithmException, CertificateException(Code)
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.LoadStoreParameterthat specifies how to load the keystore,which may be null
exception:
  IllegalArgumentException - if the givenKeyStore.LoadStoreParameterinput is not recognized
exception:
  IOException - if there is an I/O or format problem with thekeystore data. If the error is due to an incorrect ProtectionParameter (e.g. wrong password)the Throwable.getCause cause of the IOException should be an UnrecoverableKeyException
exception:
  NoSuchAlgorithmException - if the algorithm used to checkthe integrity of the keystore cannot be found
exception:
  CertificateException - if any of the certificates in thekeystore could not be loaded
since:
   1.5




engineSetCertificateEntry
abstract public void engineSetCertificateEntry(String alias, Certificate cert) throws KeyStoreException(Code)
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
Parameters:
  cert - the certificate
exception:
  KeyStoreException - if the given alias already exists and doesnot identify an entry containing a trusted certificate,or this operation fails for some other reason.




engineSetEntry
public void engineSetEntry(String alias, KeyStore.Entry entry, KeyStore.ProtectionParameter protParam) throws KeyStoreException(Code)
Saves a KeyStore.Entry under the specified alias. The specified protection parameter is used to protect the Entry.

If an entry already exists for the specified alias, it is overridden.
Parameters:
  alias - save the KeyStore.Entry under this alias
Parameters:
  entry - the Entry to save
Parameters:
  protParam - the ProtectionParameterused to protect the Entry,which may be null
exception:
  KeyStoreException - if this operation fails
since:
   1.5




engineSetKeyEntry
abstract public void engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) throws KeyStoreException(Code)
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
Parameters:
  key - the key to be associated with the alias
Parameters:
  password - the password to protect the key
Parameters:
  chain - the certificate chain for the corresponding publickey (only required if the given key is of typejava.security.PrivateKey).
exception:
  KeyStoreException - if the given key cannot be protected, orthis operation fails for some other reason




engineSetKeyEntry
abstract public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) throws KeyStoreException(Code)
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
Parameters:
  key - the key (in protected format) to be associated with the alias
Parameters:
  chain - the certificate chain for the corresponding publickey (only useful if the protected key is of typejava.security.PrivateKey).
exception:
  KeyStoreException - if this operation fails.




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



engineStore
abstract public void engineStore(OutputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException(Code)
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.
Parameters:
  password - the password to generate the keystore integrity check
exception:
  IOException - if there was an I/O problem with data
exception:
  NoSuchAlgorithmException - if the appropriate data integrityalgorithm could not be found
exception:
  CertificateException - if any of the certificates included inthe keystore data could not be stored



engineStore
public void engineStore(KeyStore.LoadStoreParameter param) throws IOException, NoSuchAlgorithmException, CertificateException(Code)
Stores this keystore using the given KeyStore.LoadStoreParmeter.
Parameters:
  param - the KeyStore.LoadStoreParmeterthat specifies how to store the keystore,which may be null
exception:
  IllegalArgumentException - if the givenKeyStore.LoadStoreParmeterinput is not recognized
exception:
  IOException - if there was an I/O problem with data
exception:
  NoSuchAlgorithmException - if the appropriate data integrityalgorithm could not be found
exception:
  CertificateException - if any of the certificates included inthe keystore data could not be stored
since:
   1.5



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.