PBEKey
Stay organized with collections
Save and categorize content based on your preferences.
The interface to a PBE key.
Constant Summary
long |
serialVersionUID |
The class fingerprint that is set to indicate serialization
compatibility since J2SE 1.4. |
Inherited Constant Summary
From interface
java.security.Key
long |
serialVersionUID |
The class fingerprint that is set to indicate
serialization compatibility with a previous
version of the class. |
Public Method Summary
abstract
int
|
|
abstract
char[]
|
|
abstract
byte[]
|
getSalt()
Returns the salt or null if not specified.
|
Inherited Method Summary
From interface
java.security.Key
abstract
String
|
getAlgorithm()
Returns the standard algorithm name for this key.
|
abstract
byte[]
|
getEncoded()
Returns the key in its primary encoding format, or null
if this key does not support encoding.
|
abstract
String
|
getFormat()
Returns the name of the primary encoding format of this key,
or null if this key does not support encoding.
|
Constants
public
static
final
long
serialVersionUID
The class fingerprint that is set to indicate serialization
compatibility since J2SE 1.4.
Constant Value:
-1430015993304333921
Public Methods
public
abstract
int
getIterationCount
()
Returns the iteration count or 0 if not specified.
public
abstract
char[]
getPassword
()
Returns the password.
Note: this method should return a copy of the password. It is
the caller's responsibility to zero out the password information after
it is no longer needed.
public
abstract
byte[]
getSalt
()
Returns the salt or null if not specified.
Note: this method should return a copy of the salt. It is
the caller's responsibility to zero out the salt information after
it is no longer needed.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003ePBEKey\u003c/code\u003e interface provides access to the password, salt, and iteration count used in Password-Based Encryption (PBE).\u003c/p\u003e\n"],["\u003cp\u003eIt extends the \u003ccode\u003eSecretKey\u003c/code\u003e interface and includes methods for retrieving PBE-specific parameters.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetPassword()\u003c/code\u003e, \u003ccode\u003egetSalt()\u003c/code\u003e, and \u003ccode\u003egetIterationCount()\u003c/code\u003e methods retrieve the password, salt, and iteration count respectively.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should securely handle the sensitive information returned by these methods, ensuring to zero out the data when no longer needed.\u003c/p\u003e\n"]]],[],null,["# PBEKey\n\npublic interface **PBEKey** implements [SecretKey](../../../../reference/javax/crypto/SecretKey.html) \nThe interface to a PBE key. \n\n##### See Also\n\n- [PBEKeySpec](../../../../reference/javax/crypto/spec/PBEKeySpec.html)\n- [SecretKey](../../../../reference/javax/crypto/SecretKey.html) \n\n### Constant Summary\n\n|------|------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|\n| long | [serialVersionUID](../../../../reference/javax/crypto/interfaces/PBEKey.html#serialVersionUID) | The class fingerprint that is set to indicate serialization compatibility since J2SE 1.4. |\n\n### Inherited Constant Summary\n\nFrom interface [javax.crypto.SecretKey](../../../../reference/javax/crypto/SecretKey.html) \n\n|------|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|\n| long | [serialVersionUID](../../../../reference/javax/crypto/SecretKey.html#serialVersionUID) | The class fingerprint that is set to indicate serialization compatibility since J2SE 1.4. |\n\nFrom interface [java.security.Key](../../../../reference/java/security/Key.html) \n\n|------|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|\n| long | [serialVersionUID](../../../../reference/java/security/Key.html#serialVersionUID) | The class fingerprint that is set to indicate serialization compatibility with a previous version of the class. |\n\n### Public Method Summary\n\n|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract int | [getIterationCount](../../../../reference/javax/crypto/interfaces/PBEKey.html#getIterationCount())() Returns the iteration count or 0 if not specified. |\n| abstract char\\[\\] | [getPassword](../../../../reference/javax/crypto/interfaces/PBEKey.html#getPassword())() Returns the password. |\n| abstract byte\\[\\] | [getSalt](../../../../reference/javax/crypto/interfaces/PBEKey.html#getSalt())() Returns the salt or null if not specified. |\n\n### Inherited Method Summary\n\nFrom interface [java.security.Key](../../../../reference/java/security/Key.html) \n\n|----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [String](../../../../reference/java/lang/String.html) | [getAlgorithm](../../../../reference/java/security/Key.html#getAlgorithm())() Returns the standard algorithm name for this key. |\n| abstract byte\\[\\] | [getEncoded](../../../../reference/java/security/Key.html#getEncoded())() Returns the key in its primary encoding format, or null if this key does not support encoding. |\n| abstract [String](../../../../reference/java/lang/String.html) | [getFormat](../../../../reference/java/security/Key.html#getFormat())() Returns the name of the primary encoding format of this key, or null if this key does not support encoding. |\n\nFrom interface [javax.security.auth.Destroyable](../../../../reference/javax/security/auth/Destroyable.html) \n\n|---------|------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [destroy](../../../../reference/javax/security/auth/Destroyable.html#destroy())() Destroy this `Object`. |\n| boolean | [isDestroyed](../../../../reference/javax/security/auth/Destroyable.html#isDestroyed())() Determine if this `Object` has been destroyed. |\n\nConstants\n---------\n\n#### public static final long\n**serialVersionUID**\n\nThe class fingerprint that is set to indicate serialization\ncompatibility since J2SE 1.4. \nConstant Value: -1430015993304333921\n\nPublic Methods\n--------------\n\n#### public abstract int\n**getIterationCount**\n()\n\nReturns the iteration count or 0 if not specified. \n\n##### Returns\n\n- the iteration count. \n\n#### public abstract char\\[\\]\n**getPassword**\n()\n\nReturns the password.\n\nNote: this method should return a copy of the password. It is\nthe caller's responsibility to zero out the password information after\nit is no longer needed. \n\n##### Returns\n\n- the password. \n\n#### public abstract byte\\[\\]\n**getSalt**\n()\n\nReturns the salt or null if not specified.\n\nNote: this method should return a copy of the salt. It is\nthe caller's responsibility to zero out the salt information after\nit is no longer needed. \n\n##### Returns\n\n- the salt."]]