Foundation 1.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 パラメータを生成します。

導入されたバージョン:
1.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, Provider provider)
          要求されたアルゴリズムのパラメータジェネレータを指定されたプロバイダから取得できる場合に、そのプロバイダが提供するアルゴリズムの 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 - プロバイダがその環境で使用できない場合
IllegalArgumentException - プロバイダ名が null または空の場合
関連項目:
Provider

getInstance

public static AlgorithmParameterGenerator getInstance(String algorithm,
                                                      Provider provider)
                                               throws NoSuchAlgorithmException
要求されたアルゴリズムのパラメータジェネレータを指定されたプロバイダから取得できる場合に、そのプロバイダが提供するアルゴリズムの AlgorithmParameterGenerator オブジェクトを生成します。注:provider を登録する必要はありません。

パラメータ:
algorithm - アルゴリズムの文字列名
provider - プロバイダ
戻り値:
新しい AlgorithmParameterGenerator オブジェクト
例外:
NoSuchAlgorithmException - プロバイダからそのアルゴリズムを取得できない場合
IllegalArgumentException - provider が null の場合
導入されたバージョン:
1.4
関連項目:
Provider

getProvider

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

戻り値:
このアルゴリズムパラメータジェネレータオブジェクトのプロバイダ

init

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

パラメータ:
size - サイズ (ビット数)

init

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

パラメータ:
size - サイズ (ビット数)
random - 乱数発生の元

init

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

パラメータ:
genParamSpec - アルゴリズム特定型のパラメータ生成値のセット
例外:
InvalidAlgorithmParameterException - 指定されたパラメータ生成値がこのパラメータジェネレータに不適切な場合

init

public final void init(AlgorithmParameterSpec genParamSpec,
                       SecureRandom random)
                throws InvalidAlgorithmParameterException
アルゴリズム特定型のパラメータ生成値のセットで、パラメータジェネレータを初期化します。

パラメータ:
genParamSpec - アルゴリズム特定型のパラメータ生成値のセット
random - 乱数発生の元
例外:
InvalidAlgorithmParameterException - 指定されたパラメータ生成値がこのパラメータジェネレータに不適切な場合

generateParameters

public final AlgorithmParameters generateParameters()
パラメータを生成します。

戻り値:
新しい AlgorithmParameters オブジェクト

Foundation 1.1.2

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。