public static class KeyStore.PasswordProtection extends Object implements KeyStore.ProtectionParameter, Destroyable
ProtectionParameter
のパスワードベースの実装です。コンストラクタ | 説明 |
---|---|
PasswordProtection(char[] password) |
パスワード・パラメータを作成します。
|
PasswordProtection(char[] password, String protectionAlgorithm, AlgorithmParameterSpec protectionParameters) |
パスワード・パラメータを作成し、キーストア・エントリを暗号化するときに使用する保護アルゴリズムと関連パラメータを指定します。
|
修飾子と型 | メソッド | 説明 |
---|---|---|
void |
destroy() |
パスワードをクリアします。
|
char[] |
getPassword() |
パスワードを取得します。
|
String |
getProtectionAlgorithm() |
保護アルゴリズムの名前を取得します。
|
AlgorithmParameterSpec |
getProtectionParameters() |
保護アルゴリズムに対して指定されたパラメータを取得します。
|
boolean |
isDestroyed() |
パスワードがクリアされているかどうかを判定します。
|
public PasswordProtection(char[] password)
指定されたpassword
は、複製されてから新しいPasswordProtection
オブジェクトに格納されます。
password
- パスワード。null
の場合もあるpublic PasswordProtection(char[] password, String protectionAlgorithm, AlgorithmParameterSpec protectionParameters)
指定されたpassword
は、複製されてから新しいPasswordProtection
オブジェクトに格納されます。
password
- パスワード。null
の場合もあるprotectionAlgorithm
- 暗号化アルゴリズム名(たとえば、PBEWithHmacSHA256AndAES_256
)。 暗号化アルゴリズムの標準名については、Java暗号化アーキテクチャ標準アルゴリズム名のドキュメントのCipherの項を参照。 protectionParameters
- 暗号化アルゴリズム・パラメータの仕様。null
の場合もあるNullPointerException
- protectionAlgorithm
がnull
の場合public String getProtectionAlgorithm()
'keystore.<type>.keyProtectionAlgorithm'
セキュリティ・プロパティを使用して設定されます。 たとえば、keystore.PKCS12.keyProtectionAlgorithm
プロパティには、PKCS12キーストアで使用されるデフォルトのキー保護アルゴリズムの名前が格納されます。 このセキュリティ・プロパティが設定されていない場合は、実装固有のアルゴリズムが使用されます。 null
public AlgorithmParameterSpec getProtectionParameters()
null
public char[] getPassword()
このメソッドはパスワードへの参照を返します。 この配列の複製を作成した場合、不要になったパスワード情報は、呼出し側でゼロにする(消去する)必要があります。
null
の場合もあるIllegalStateException
- パスワードがクリア(破棄)されている場合destroy()
public void destroy() throws DestroyFailedException
destroy
、インタフェースDestroyable
DestroyFailedException
- このメソッドがパスワードをクリアできなかった場合public boolean isDestroyed()
isDestroyed
、インタフェースDestroyable
バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。