Java プラットフォーム 1.2

java.security
クラス AlgorithmParameterGenerator

java.lang.Object
  |
  +--java.security.AlgorithmParameterGenerator

public class AlgorithmParameterGenerator
extends Object

AlgorithmParameterGenerator クラスは、特定のアルゴリズムで使われるパラメータのセットを生成するために使用されます。パラメータジェネレータは、getInstance ファクトリメソッド (指定したクラスのインスタンスを返す static メソッド) を使って構築されます。

パラメータを生成するオブジェクトは、アルゴリズムに依存しない方法、およびアルゴリズム特定型の方法の 2 通りの方法で初期化できます。

クライアントが init メソッドの呼び出しで、明示的に AlgorithmParameterGenerator を初期化しない場合には、各プロバイダはデフォルトの初期化を提供およびドキュメント化する必要があります。たとえば Sun のプロバイダのデフォルトでは、1,024 ビットのモジュラスプライムサイズを使って DSA パラメータを生成します。

導入されたバージョン:
JDK1.2
関連項目:
AlgorithmParameters, AlgorithmParameterSpec

コンストラクタの概要
protected AlgorithmParameterGenerator(AlgorithmParameterGeneratorSpi paramGenSpi, Provider provider, String algorithm)
          AlgorithmParameterGenerator オブジェクトを作成します。
 
メソッドの概要
 AlgorithmParameters generateParameters()
          パラメータを生成します。
 String getAlgorithm()
          パラメータジェネレータが関連付けられているアルゴリズムの標準名を返します。
static AlgorithmParameterGenerator getInstance(String algorithm)
          指定されたダイジェストアルゴリズムを実装する AlgorithmParameterGenerator オブジェクトを作成します。
static AlgorithmParameterGenerator getInstance(String algorithm, String provider)
          指定されたプロバイダから提供される、要求したアルゴリズムの AlgorithmParameterGenerator オブジェクトを作成します。
 Provider getProvider()
          アルゴリズムパラメータジェネレータオブジェクトのプロバイダを返します。
 void init(AlgorithmParameterSpec genParamSpec)
          アルゴリズム特定型のパラメータ生成値のセットで、パラメータジェネレータを初期化します。
 void init(AlgorithmParameterSpec genParamSpec, SecureRandom random)
          アルゴリズム特定型のパラメータ生成値のセットで、パラメータジェネレータを初期化します。
 void init(int size)
          特定のサイズに対して、パラメータジェネレータを初期化します。
 void init(int size, SecureRandom random)
          特定のサイズと乱数発生の元に対して、パラメータジェネレータを初期化します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

AlgorithmParameterGenerator

protected AlgorithmParameterGenerator(AlgorithmParameterGeneratorSpi paramGenSpi,
                                      Provider provider,
                                      String algorithm)
AlgorithmParameterGenerator オブジェクトを作成します。
パラメータ:
paramGenSpi - 委譲
provider - プロバイダ
algorithm - アルゴリズム
メソッドの詳細

getAlgorithm

public final String getAlgorithm()
パラメータジェネレータが関連付けられているアルゴリズムの標準名を返します。
戻り値:
アルゴリズムの文字列名

getInstance

public static AlgorithmParameterGenerator getInstance(String algorithm)
                                               throws NoSuchAlgorithmException
指定されたダイジェストアルゴリズムを実装する AlgorithmParameterGenerator オブジェクトを作成します。要求されるダイジェストアルゴリズムの実装をデフォルトのプロバイダパッケージが提供する場合は、その実装を含む AlgorithmParameterGenerator のインスタンスが返されます。デフォルトパッケージで目的のアルゴリズムが提供されていない場合には、他のパッケージが検索されます。
パラメータ:
algorithm - このパラメータジェネレータが関連付けられているアルゴリズムの文字列名
戻り値:
新しい AlgorithmParameterGenerator オブジェクト
例外:
NoSuchAlgorithmException - アルゴリズムが環境で提供されていない場合

getInstance

public static AlgorithmParameterGenerator getInstance(String algorithm,
                                                      String provider)
                                               throws NoSuchAlgorithmException,
                                                      NoSuchProviderException
指定されたプロバイダから提供される、要求したアルゴリズムの AlgorithmParameterGenerator オブジェクトを作成します。ただし、そのようなパラメータジェネレータがプロバイダから使用可能な場合に限ります。
パラメータ:
algorithm - アルゴリズムの文字列名
provider - プロバイダの文字列名
戻り値:
新しい AlgorithmParameterGenerator オブジェクト
例外:
NoSuchAlgorithmException - プロバイダからアルゴリズムが提供されていない場合
NoSuchProviderException - プロバイダが環境で提供されていない場合
関連項目:
Provider

getProvider

public final Provider getProvider()
アルゴリズムパラメータジェネレータオブジェクトのプロバイダを返します。
戻り値:
このアルゴリズムパラメータジェネレータオブジェクトのプロバイダ

init

public final void init(int size)
特定のサイズに対して、パラメータジェネレータを初期化します。パラメータを生成する際には、インストールされているプロバイダの内、もっとも優先順位の高いプロバイダの SecureRandom の実装が、乱数発生の元として使用されます 。SecureRandom の実装を提供するプロバイダがインストールされていない場合は、システムが提供する乱数発生の元が使用されます。
パラメータ:
size - サイズ (ビット数)

init

public final void init(int size,
                       SecureRandom random)
特定のサイズと乱数発生の元に対して、パラメータジェネレータを初期化します。
パラメータ:
size - サイズ (ビット数)
random - 乱数発生の元

init

public final void init(AlgorithmParameterSpec genParamSpec)
                throws InvalidAlgorithmParameterException
アルゴリズム特定型のパラメータ生成値のセットで、パラメータジェネレータを初期化します。パラメータを生成する際には、インストールされているプロバイダの内、もっとも優先順位の高いプロバイダの SecureRandom の実装が、乱数発生の元として使用されます 。SecureRandom の実装を提供するプロバイダがインストールされていない場合は、システムが提供する乱数発生の元が使用されます。
パラメータ:
genParamSpec - アルゴリズム特定型のパラメータ生成値のセット
例外:
InvalidAlgorithmParameterException - 指定されたパラメータ生成値がこのパラメータジェネレータに不適切な場合

init

public final void init(AlgorithmParameterSpec genParamSpec,
                       SecureRandom random)
                throws InvalidAlgorithmParameterException
アルゴリズム特定型のパラメータ生成値のセットで、パラメータジェネレータを初期化します。
パラメータ:
genParamSpec - アルゴリズム特定型のパラメータ生成値のセット
random - 乱数発生の元
例外:
InvalidAlgorithmParameterException - 指定されたパラメータ生成値がこのパラメータジェネレータに不適切な場合

generateParameters

public final AlgorithmParameters generateParameters()
パラメータを生成します。
戻り値:
新しい AlgorithmParameters オブジェクト

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.