KeyStore.SecretKeyEntry
Stay organized with collections
Save and categorize content based on your preferences.
A KeyStore
entry that holds a SecretKey
.
Public Constructor Summary
Inherited Method Summary
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals( Object obj)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long timeout, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long timeout)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
Public Constructors
public
SecretKeyEntry
(SecretKey secretKey)
Constructs a SecretKeyEntry
with a
SecretKey
.
Constructs a SecretKeyEntry
with a SecretKey
and
associated entry attributes.
The specified attributes
is cloned before it is stored
in the new SecretKeyEntry
object.
Parameters
secretKey |
the SecretKey |
attributes |
the attributes |
Public Methods
Retrieves the attributes associated with an entry.
Returns
- an unmodifiable
Set
of attributes, possibly empty
public
SecretKey
getSecretKey
()
Gets the SecretKey
from this entry.
Returns
- the
SecretKey
from this entry
public
String
toString
()
Returns a string representation of this SecretKeyEntry.
Returns
- a string representation of this SecretKeyEntry.
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\u003eKeyStore.SecretKeyEntry\u003c/code\u003e is a class that securely stores a \u003ccode\u003eSecretKey\u003c/code\u003e within a \u003ccode\u003eKeyStore\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to construct an entry with a \u003ccode\u003eSecretKey\u003c/code\u003e, optionally including associated attributes.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve the stored \u003ccode\u003eSecretKey\u003c/code\u003e and its attributes using dedicated methods.\u003c/p\u003e\n"],["\u003cp\u003eThis class inherits basic functionalities from \u003ccode\u003eObject\u003c/code\u003e and implements the \u003ccode\u003eKeyStore.Entry\u003c/code\u003e interface.\u003c/p\u003e\n"]]],["`KeyStore.SecretKeyEntry` holds a `SecretKey`. It can be constructed with a `SecretKey` or with a `SecretKey` and entry attributes. Key actions include: creating a `SecretKeyEntry`, retrieving the `SecretKey` via `getSecretKey()`, and obtaining entry attributes using `getAttributes()`. It provides a `toString()` method for string representation. It also includes methods inherited from `Object` class, like `clone` and `equals`, and from the `KeyStore.Entry` interface.\n"],null,["# KeyStore.SecretKeyEntry\n\npublic static final class **KeyStore.SecretKeyEntry** extends [Object](../../../reference/java/lang/Object.html) \nimplements [KeyStore.Entry](../../../reference/java/security/KeyStore.Entry.html) \nA `KeyStore` entry that holds a `SecretKey`. \n\n### Public Constructor Summary\n\n|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [SecretKeyEntry](../../../reference/java/security/KeyStore.SecretKeyEntry.html#SecretKeyEntry(javax.crypto.SecretKey))([SecretKey](../../../reference/javax/crypto/SecretKey.html) secretKey) Constructs a `SecretKeyEntry` with a `SecretKey`. |\n| | [SecretKeyEntry](../../../reference/java/security/KeyStore.SecretKeyEntry.html#SecretKeyEntry(javax.crypto.SecretKey,%20java.util.Set\u003cjava.security.KeyStore.Entry.Attribute\u003e))([SecretKey](../../../reference/javax/crypto/SecretKey.html) secretKey, [Set](../../../reference/java/util/Set.html)\\\u003c[KeyStore.Entry.Attribute](../../../reference/java/security/KeyStore.Entry.Attribute.html)\\\u003e attributes) Constructs a `SecretKeyEntry` with a `SecretKey` and associated entry attributes. |\n\n### Public Method Summary\n\n|--------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Set](../../../reference/java/util/Set.html)\\\u003c[KeyStore.Entry.Attribute](../../../reference/java/security/KeyStore.Entry.Attribute.html)\\\u003e | [getAttributes](../../../reference/java/security/KeyStore.SecretKeyEntry.html#getAttributes())() Retrieves the attributes associated with an entry. |\n| [SecretKey](../../../reference/javax/crypto/SecretKey.html) | [getSecretKey](../../../reference/java/security/KeyStore.SecretKeyEntry.html#getSecretKey())() Gets the `SecretKey` from this entry. |\n| [String](../../../reference/java/lang/String.html) | [toString](../../../reference/java/security/KeyStore.SecretKeyEntry.html#toString())() Returns a string representation of this SecretKeyEntry. |\n\n### Inherited Method Summary\n\nFrom class [java.lang.Object](../../../reference/java/lang/Object.html) \n\n|-------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Object](../../../reference/java/lang/Object.html) | [clone](../../../reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |\n| boolean | [equals](../../../reference/java/lang/Object.html#equals(java.lang.Object))([Object](../../../reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |\n| void | [finalize](../../../reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |\n| final [Class](../../../reference/java/lang/Class.html)\\\u003c?\\\u003e | [getClass](../../../reference/java/lang/Object.html#getClass())() Returns the unique instance of [Class](../../../reference/java/lang/Class.html) that represents this object's class. |\n| int | [hashCode](../../../reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |\n| final void | [notify](../../../reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |\n| final void | [notifyAll](../../../reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |\n| [String](../../../reference/java/lang/String.html) | [toString](../../../reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |\n| final void | [wait](../../../reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |\n| final void | [wait](../../../reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |\n| final void | [wait](../../../reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |\n\nFrom interface [java.security.KeyStore.Entry](../../../reference/java/security/KeyStore.Entry.html) \n\n|--------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| [Set](../../../reference/java/util/Set.html)\\\u003c[KeyStore.Entry.Attribute](../../../reference/java/security/KeyStore.Entry.Attribute.html)\\\u003e | [getAttributes](../../../reference/java/security/KeyStore.Entry.html#getAttributes())() Retrieves the attributes associated with an entry. |\n\nPublic Constructors\n-------------------\n\n#### public\n**SecretKeyEntry**\n([SecretKey](../../../reference/javax/crypto/SecretKey.html) secretKey)\n\nConstructs a `SecretKeyEntry` with a\n`SecretKey`. \n\n##### Parameters\n\n| secretKey | the `SecretKey` |\n|-----------|-----------------|\n\n##### Throws\n\n| [NullPointerException](../../../reference/java/lang/NullPointerException.html) | if `secretKey` is `null` |\n|--------------------------------------------------------------------------------|--------------------------|\n\n#### public\n**SecretKeyEntry**\n([SecretKey](../../../reference/javax/crypto/SecretKey.html) secretKey, [Set](../../../reference/java/util/Set.html)\\\u003c[KeyStore.Entry.Attribute](../../../reference/java/security/KeyStore.Entry.Attribute.html)\\\u003e attributes)\n\nConstructs a `SecretKeyEntry` with a `SecretKey` and\nassociated entry attributes.\n\nThe specified `attributes` is cloned before it is stored\nin the new `SecretKeyEntry` object. \n\n##### Parameters\n\n| secretKey | the `SecretKey` |\n| attributes | the attributes |\n|------------|-----------------|\n\n##### Throws\n\n| [NullPointerException](../../../reference/java/lang/NullPointerException.html) | if `secretKey` or `attributes` is `null` |\n|--------------------------------------------------------------------------------|------------------------------------------|\n\nPublic Methods\n--------------\n\n#### public [Set](../../../reference/java/util/Set.html)\\\u003c[KeyStore.Entry.Attribute](../../../reference/java/security/KeyStore.Entry.Attribute.html)\\\u003e\n**getAttributes**\n()\n\nRetrieves the attributes associated with an entry.\n\n\u003cbr /\u003e\n\n##### Returns\n\n- an unmodifiable `Set` of attributes, possibly empty \n\n#### public [SecretKey](../../../reference/javax/crypto/SecretKey.html)\n**getSecretKey**\n()\n\nGets the `SecretKey` from this entry. \n\n##### Returns\n\n- the `SecretKey` from this entry \n\n#### public [String](../../../reference/java/lang/String.html)\n**toString**\n()\n\nReturns a string representation of this SecretKeyEntry. \n\n##### Returns\n\n- a string representation of this SecretKeyEntry."]]