Java Doc for KeyManagerFactory.java in  » 6.0-JDK-Core » net » javax » net » ssl » 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 » net » javax.net.ssl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.net.ssl.KeyManagerFactory

KeyManagerFactory
public class KeyManagerFactory (Code)
This class acts as a factory for key managers based on a source of key material. Each key manager manages a specific type of key material for use by secure sockets. The key material is based on a KeyStore and/or provider specific sources.
since:
   1.4
See Also:   KeyManager
version:
   1.28, 05/05/07



Constructor Summary
protected  KeyManagerFactory(KeyManagerFactorySpi factorySpi, Provider provider, String algorithm)
     Creates a KeyManagerFactory object.

Method Summary
final public  StringgetAlgorithm()
     Returns the algorithm name of this KeyManagerFactory object.
final public static  StringgetDefaultAlgorithm()
     Obtains the default KeyManagerFactory algorithm name.
final public static  KeyManagerFactorygetInstance(String algorithm)
     Returns a KeyManagerFactory object that acts as a factory for key managers.

This method traverses the list of registered security Providers, starting with the most preferred Provider. A new KeyManagerFactory object encapsulating the KeyManagerFactorySpi implementation from the first Provider that supports the specified algorithm is returned.

Note that the list of registered providers may be retrieved via the Security.getProviders Security.getProviders() method.
Parameters:
  algorithm - the standard name of the requested algorithm.See the Java Secure Socket Extension Reference Guide for information about standard algorithm names.

final public static  KeyManagerFactorygetInstance(String algorithm, String provider)
     Returns a KeyManagerFactory object that acts as a factory for key managers.

A new KeyManagerFactory object encapsulating the KeyManagerFactorySpi implementation from the specified provider is returned.

final public static  KeyManagerFactorygetInstance(String algorithm, Provider provider)
     Returns a KeyManagerFactory object that acts as a factory for key managers.

A new KeyManagerFactory object encapsulating the KeyManagerFactorySpi implementation from the specified Provider object is returned.

final public  KeyManager[]getKeyManagers()
     Returns one key manager for each type of key material.
final public  ProvidergetProvider()
     Returns the provider of this KeyManagerFactory object.
final public  voidinit(KeyStore ks, char[] password)
     Initializes this factory with a source of key material.

The provider typically uses a KeyStore for obtaining key material for use during secure socket negotiations. The KeyStore is generally password-protected.

For more flexible initialization, please see KeyManagerFactory.init(ManagerFactoryParameters) .


Parameters:
  ks - the key store or null
Parameters:
  password - the password for recovering keys in the KeyStore
throws:
  KeyStoreException - if this operation fails
throws:
  NoSuchAlgorithmException - if the specified algorithm is notavailable from the specified provider.
throws:
  UnrecoverableKeyException - if the key cannot be recovered(e.g.

final public  voidinit(ManagerFactoryParameters spec)
     Initializes this factory with a source of provider-specific key material.

In some cases, initialization parameters other than a keystore and password may be needed by a provider.



Constructor Detail
KeyManagerFactory
protected KeyManagerFactory(KeyManagerFactorySpi factorySpi, Provider provider, String algorithm)(Code)
Creates a KeyManagerFactory object.
Parameters:
  factorySpi - the delegate
Parameters:
  provider - the provider
Parameters:
  algorithm - the algorithm




Method Detail
getAlgorithm
final public String getAlgorithm()(Code)
Returns the algorithm name of this KeyManagerFactory object.

This is the same name that was specified in one of the getInstance calls that created this KeyManagerFactory object. the algorithm name of this KeyManagerFactory object.




getDefaultAlgorithm
final public static String getDefaultAlgorithm()(Code)
Obtains the default KeyManagerFactory algorithm name.

The default algorithm can be changed at runtime by setting the value of the "ssl.KeyManagerFactory.algorithm" security property (set in the Java security properties file or by calling java.security.Security.setProperty(java.lang.Stringjava.lang.String) ) to the desired algorithm name.
See Also:   java.security.Security.setProperty(java.lang.Stringjava.lang.String) the default algorithm name as specified in theJava security properties, or an implementation-specificdefault if no such property exists.




getInstance
final public static KeyManagerFactory getInstance(String algorithm) throws NoSuchAlgorithmException(Code)
Returns a KeyManagerFactory object that acts as a factory for key managers.

This method traverses the list of registered security Providers, starting with the most preferred Provider. A new KeyManagerFactory object encapsulating the KeyManagerFactorySpi implementation from the first Provider that supports the specified algorithm is returned.

Note that the list of registered providers may be retrieved via the Security.getProviders Security.getProviders() method.
Parameters:
  algorithm - the standard name of the requested algorithm.See the Java Secure Socket Extension Reference Guide for information about standard algorithm names. the new KeyManagerFactory object.
exception:
  NoSuchAlgorithmException - if no Provider supports aKeyManagerFactorySpi implementation for thespecified algorithm.
exception:
  NullPointerException - if algorithm is null.
See Also:   java.security.Provider




getInstance
final public static KeyManagerFactory getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException(Code)
Returns a KeyManagerFactory object that acts as a factory for key managers.

A new KeyManagerFactory object encapsulating the KeyManagerFactorySpi implementation from the specified provider is returned. The specified provider must be registered in the security provider list.

Note that the list of registered providers may be retrieved via the Security.getProviders Security.getProviders() method.
Parameters:
  algorithm - the standard name of the requested algorithm.See the Java Secure Socket Extension Reference Guide for information about standard algorithm names.
Parameters:
  provider - the name of the provider. the new KeyManagerFactory object.
throws:
  NoSuchAlgorithmException - if a KeyManagerFactorySpiimplementation for the specified algorithm is notavailable from the specified provider.
throws:
  NoSuchProviderException - if the specified provider is notregistered in the security provider list.
throws:
  IllegalArgumentException - if the provider name is null or empty.
throws:
  NullPointerException - if algorithm is null.
See Also:   java.security.Provider




getInstance
final public static KeyManagerFactory getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException(Code)
Returns a KeyManagerFactory object that acts as a factory for key managers.

A new KeyManagerFactory object encapsulating the KeyManagerFactorySpi implementation from the specified Provider object is returned. Note that the specified Provider object does not have to be registered in the provider list.
Parameters:
  algorithm - the standard name of the requested algorithm.See the Java Secure Socket Extension Reference Guide for information about standard algorithm names.
Parameters:
  provider - an instance of the provider. the new KeyManagerFactory object.
throws:
  NoSuchAlgorithmException - if a KeyManagerFactorySpiimplementation for the specified algorithm is not availablefrom the specified Provider object.
throws:
  IllegalArgumentException - if provider is null.
throws:
  NullPointerException - if algorithm is null.
See Also:   java.security.Provider




getKeyManagers
final public KeyManager[] getKeyManagers()(Code)
Returns one key manager for each type of key material. the key managers
throws:
  IllegalStateException - if the KeyManagerFactory is not initialized



getProvider
final public Provider getProvider()(Code)
Returns the provider of this KeyManagerFactory object. the provider of this KeyManagerFactory object



init
final public void init(KeyStore ks, char[] password) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException(Code)
Initializes this factory with a source of key material.

The provider typically uses a KeyStore for obtaining key material for use during secure socket negotiations. The KeyStore is generally password-protected.

For more flexible initialization, please see KeyManagerFactory.init(ManagerFactoryParameters) .


Parameters:
  ks - the key store or null
Parameters:
  password - the password for recovering keys in the KeyStore
throws:
  KeyStoreException - if this operation fails
throws:
  NoSuchAlgorithmException - if the specified algorithm is notavailable from the specified provider.
throws:
  UnrecoverableKeyException - if the key cannot be recovered(e.g. the given password is wrong).




init
final public void init(ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException(Code)
Initializes this factory with a source of provider-specific key material.

In some cases, initialization parameters other than a keystore and password may be needed by a provider. Users of that particular provider are expected to pass an implementation of the appropriate ManagerFactoryParameters as defined by the provider. The provider can then call the specified methods in the ManagerFactoryParameters implementation to obtain the needed information.
Parameters:
  spec - an implementation of a provider-specific parameterspecification
throws:
  InvalidAlgorithmParameterException - if an error is encountered




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.