Stay organized with collections
Save and categorize content based on your preferences.
PBEKey
public
interface
PBEKey
implements
SecretKey
javax.crypto.interfaces.PBEKey
|
The interface to a PBE key.
Summary
Constants |
long |
serialVersionUID
The class fingerprint that is set to indicate serialization
compatibility since J2SE 1.4.
|
Inherited constants |
|
From interface
java.security.Key
long |
serialVersionUID
This constant was deprecated
in API level 34.
A serialVersionUID field in an interface is
ineffectual. Do not use; no replacement.
|
|
Public methods |
abstract
int
|
getIterationCount()
Returns the iteration count or 0 if not specified.
|
abstract
char[]
|
getPassword()
Returns the password.
|
abstract
byte[]
|
getSalt()
Returns the salt or null if not specified.
|
Inherited methods |
|
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
serialVersionUID
public static final long serialVersionUID
The class fingerprint that is set to indicate serialization
compatibility since J2SE 1.4.
Constant Value:
-1430015993304333921
(0xec279007d7f7c19f)
Public methods
getIterationCount
public abstract int getIterationCount ()
Returns the iteration count or 0 if not specified.
Returns |
int |
the iteration count. |
getPassword
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.
Returns |
char[] |
the password. |
getSalt
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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# PBEKey\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Constants](#constants) \\| [Inherited Constants](#inhconstants) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nPBEKey\n======\n\n\n`\npublic\n\n\ninterface\nPBEKey\n`\n\n\n`\n\n\nimplements\n\n`[SecretKey](/reference/javax/crypto/SecretKey)`\n\n\n`\n\n|--------------------------------|\n| javax.crypto.interfaces.PBEKey |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe interface to a PBE key. \n**See also:**\n\n- [PBEKeySpec](/reference/javax/crypto/spec/PBEKeySpec)\n- [SecretKey](/reference/javax/crypto/SecretKey)\n\nSummary\n-------\n\n| ### Constants ||\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `long` | [serialVersionUID](/reference/javax/crypto/interfaces/PBEKey#serialVersionUID) The class fingerprint that is set to indicate serialization compatibility since J2SE 1.4. |\n\n| ### Inherited constants |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| From interface [javax.crypto.SecretKey](/reference/javax/crypto/SecretKey) |--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `long` | [serialVersionUID](/reference/javax/crypto/SecretKey#serialVersionUID) The class fingerprint that is set to indicate serialization compatibility since J2SE 1.4. | |\n| From interface [java.security.Key](/reference/java/security/Key) |--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `long` | [serialVersionUID](/reference/java/security/Key#serialVersionUID) *This constant was deprecated in API level 34. A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.* | |\n\n| ### Public methods ||\n|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract int` | ` `[getIterationCount](/reference/javax/crypto/interfaces/PBEKey#getIterationCount())`() ` Returns the iteration count or 0 if not specified. |\n| ` abstract char[]` | ` `[getPassword](/reference/javax/crypto/interfaces/PBEKey#getPassword())`() ` Returns the password. |\n| ` abstract byte[]` | ` `[getSalt](/reference/javax/crypto/interfaces/PBEKey#getSalt())`() ` Returns the salt or null if not specified. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[javax.security.auth.Destroyable](/reference/javax/security/auth/Destroyable)` ` |--------------------|--------------------------------------------------------------------------------------------------------------------------------| | ` default void` | ` `[destroy](/reference/javax/security/auth/Destroyable#destroy())`() ` Destroy this `Object`. | | ` default boolean` | ` `[isDestroyed](/reference/javax/security/auth/Destroyable#isDestroyed())`() ` Determine if this `Object` has been destroyed. | ||\n| From interface ` `[java.security.Key](/reference/java/security/Key)` ` |---------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[String](/reference/java/lang/String) | ` `[getAlgorithm](/reference/java/security/Key#getAlgorithm())`() ` Returns the standard algorithm name for this key. | | ` abstract byte[]` | ` `[getEncoded](/reference/java/security/Key#getEncoded())`() ` Returns the key in its primary encoding format, or null if this key does not support encoding. | | ` abstract `[String](/reference/java/lang/String) | ` `[getFormat](/reference/java/security/Key#getFormat())`() ` Returns the name of the primary encoding format of this key, or null if this key does not support encoding. | ||\n\nConstants\n---------\n\n### serialVersionUID\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final long serialVersionUID\n```\n\nThe class fingerprint that is set to indicate serialization\ncompatibility since J2SE 1.4.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n-1430015993304333921\n(0xec279007d7f7c19f)\n\n\nPublic methods\n--------------\n\n### getIterationCount\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getIterationCount ()\n```\n\nReturns the iteration count or 0 if not specified.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|-----------------------------|\n| `int` | the iteration count. \u003cbr /\u003e |\n\n### getPassword\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract char[] 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\u003cbr /\u003e\n\n| Returns ||\n|----------|----------------------|\n| `char[]` | the password. \u003cbr /\u003e |\n\n### getSalt\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract byte[] 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\u003cbr /\u003e\n\n| Returns ||\n|----------|------------------|\n| `byte[]` | the salt. \u003cbr /\u003e |"]]