AI-generated Key Takeaways
-
KeyStore.SecretKeyEntryis a class that securely stores aSecretKeywithin aKeyStore. -
It provides methods to construct an entry with a
SecretKey, optionally including associated attributes. -
You can retrieve the stored
SecretKeyand its attributes using dedicated methods. -
This class inherits basic functionalities from
Objectand implements theKeyStore.Entryinterface.
A KeyStore entry that holds a SecretKey.
Public Constructor Summary
|
SecretKeyEntry(SecretKey secretKey, Set<KeyStore.Entry.Attribute> attributes)
Constructs a
SecretKeyEntry with a SecretKey and
associated entry attributes. |
Public Method Summary
| Set<KeyStore.Entry.Attribute> |
getAttributes()
Retrieves the attributes associated with an entry.
|
| SecretKey |
getSecretKey()
Gets the
SecretKey from this entry. |
| String |
toString()
Returns a string representation of this SecretKeyEntry.
|
Inherited Method Summary
Public Constructors
public SecretKeyEntry (SecretKey secretKey)
Constructs a SecretKeyEntry with a
SecretKey.
Parameters
| secretKey | the SecretKey |
|---|
Throws
| NullPointerException | if secretKey
is null
|
|---|
public SecretKeyEntry (SecretKey secretKey, Set<KeyStore.Entry.Attribute> attributes)
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 |
Throws
| NullPointerException | if secretKey or
attributes is null |
|---|
Public Methods
public Set<KeyStore.Entry.Attribute> getAttributes ()
Retrieves the attributes associated with an entry.
Returns
- an unmodifiable
Setof attributes, possibly empty
public SecretKey getSecretKey ()
Gets the SecretKey from this entry.
Returns
- the
SecretKeyfrom this entry
public String toString ()
Returns a string representation of this SecretKeyEntry.
Returns
- a string representation of this SecretKeyEntry.