|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjava.security.KeyStore.Builder
public abstract static class KeyStore.Builder
インスタンス化すべき KeyStore オブジェクトを記述したクラスです。
このクラスのインスタンスは、KeyStore オブジェクトのインスタンス化と初期化に必要な情報をカプセル化します。getKeyStore() メソッドを呼び出すと、この処理が起動されます。
これにより、KeyStore オブジェクト作成から構成を分離することができ、必要になるまでパスワードプロンプトを遅延化させることなどが可能となります。
KeyStore,
KeyStoreBuilderParameters| コンストラクタの概要 | |
|---|---|
protected |
KeyStore.Builder()
新しい Builder を構築します。 |
| メソッドの概要 | |
|---|---|
abstract KeyStore |
getKeyStore()
このオブジェクトが記述する KeyStore を返します。 |
abstract KeyStore.ProtectionParameter |
getProtectionParameter(String alias)
指定された別名の Entry を取得する際に使用すべき ProtectionParameter を返します。 |
static KeyStore.Builder |
newInstance(KeyStore keyStore,
KeyStore.ProtectionParameter protectionParameter)
指定された KeyStore をカプセル化する新しい Builder を返します。 |
static KeyStore.Builder |
newInstance(String type,
Provider provider,
File file,
KeyStore.ProtectionParameter protection)
新しい Builder オブジェクトを返します。 |
static KeyStore.Builder |
newInstance(String type,
Provider provider,
KeyStore.ProtectionParameter protection)
新しい Builder オブジェクトを返します。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
protected KeyStore.Builder()
| メソッドの詳細 |
|---|
public abstract KeyStore getKeyStore()
throws KeyStoreException
KeyStoreException - 処理中にエラーが発生した場合 (KeyStore のインスタンス化またはロードに失敗したなど)
public abstract KeyStore.ProtectionParameter getProtectionParameter(String alias)
throws KeyStoreException
Entry を取得する際に使用すべき ProtectionParameter を返します。getKeyStore メソッドを呼び出した後でないと、このメソッドを呼び出せません。
alias - KeyStore エントリの別名
Entry を取得する際に使用すべき ProtectionParameter
NullPointerException - alias が null である場合
KeyStoreException - 処理中にエラーが発生した場合
IllegalStateException - このメソッドを呼び出す前に getKeyStore メソッドを呼び出していない場合
public static KeyStore.Builder newInstance(KeyStore keyStore,
KeyStore.ProtectionParameter protectionParameter)
keyStore が返されます。getProtectionParameter() メソッドからは protectionParameter が返されます。
このメソッドは、Builder ベースの API で既存の KeyStore オブジェクトを使用する必要がある場合に便利です。
keyStore - カプセル化する KeyStoreprotectionParameter - KeyStore エントリの保護に使用する ProtectionParameter
NullPointerException - keyStore または protectionParameter のいずれかが null である場合
IllegalArgumentException - keyStore が初期化されていない場合
public static KeyStore.Builder newInstance(String type,
Provider provider,
File file,
KeyStore.ProtectionParameter protection)
返されたビルダ上での初回の getKeyStore() メソッド呼び出しでは、type 型の KeyStore が作成されるとともに、その load() メソッドが呼び出されます。inputStream 引数は file に基づいて構築されます。protection が PasswordProtection である場合、パスワードを取得するには getPassword メソッドを呼び出します。protection が CallbackHandlerProtection である場合、パスワードを取得するには CallbackHandler を呼び出します。
後続の getKeyStore() 呼び出しでは、初回の呼び出し時と同じオブジェクトが返されます。初回の呼び出しが KeyStoreException で失敗した場合、後続の呼び出しでも KeyStoreException がスローされます。
provider が null でない場合、そのプロバイダから KeyStore がインスタンス化されます。そうでない場合は、インストールされたすべてのプロバイダが検索されます。
getProtectionParameter() を呼び出すと、load メソッドの呼び出し時に使用されたパスワードをカプセル化した PasswordProtection オブジェクトが返されます。
getKeyStore() メソッドは、このメソッドを呼び出しているコードの AccessControlContext 内で実行されることに注意してください。
type - 構築する KeyStore の型provider - KeyStore をインスタンス化する際の基となるプロバイダまたは nullfile - KeyStore データが格納された Fileprotection - KeyStore データを保護する ProtectionParameter
NullPointerException - type、file、またはprotection のいずれかが null である場合
IllegalArgumentException - protection が PasswordProtection、CallbackHandlerProtection のいずれのインスタンスでもない場合、あるいは file が存在しないか、通常のファイルを参照していない場合
public static KeyStore.Builder newInstance(String type,
Provider provider,
KeyStore.ProtectionParameter protection)
返されたビルダ上で getKeyStore() メソッドを呼び出すたびに、型 type の新しい KeyStore オブジェクトが返されます。その load() メソッドは、protection をカプセル化した LoadStoreParameter を使用して呼び出されます。
provider が null でない場合、そのプロバイダから KeyStore がインスタンス化されます。そうでない場合は、インストールされたすべてのプロバイダが検索されます。
getProtectionParameter() を呼び出すと、protection が返されます。
getKeyStore() メソッドは、このメソッドを呼び出しているコードの AccessControlContext 内で実行されることに注意してください。
type - 構築する KeyStore の型provider - KeyStore をインスタンス化する際の基となるプロバイダまたは nullprotection - キーストアを保護する ProtectionParameter
NullPointerException - type、protection のいずれかが null である場合
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。