Stay organized with collections
Save and categorize content based on your preferences.
SecretKeyEntry
class SecretKeyEntry : KeyStore.Entry
A KeyStore
entry that holds a SecretKey
.
Summary
Public constructors |
Constructs a SecretKeyEntry with a SecretKey .
|
Constructs a SecretKeyEntry with a SecretKey and associated entry attributes.
|
Public constructors
SecretKeyEntry
SecretKeyEntry(secretKey: SecretKey!)
Constructs a SecretKeyEntry
with a SecretKey
.
Parameters |
secretKey |
SecretKey!: the SecretKey |
Exceptions |
java.lang.NullPointerException |
if secretKey is null |
SecretKeyEntry
SecretKeyEntry(
secretKey: SecretKey!,
attributes: MutableSet<KeyStore.Entry.Attribute!>!)
Constructs a SecretKeyEntry
with a SecretKey
and associated entry attributes.
The specified attributes
is cloned before it is stored in the new SecretKeyEntry
object.
Exceptions |
java.lang.NullPointerException |
if secretKey or attributes is null |
Public methods
getSecretKey
fun getSecretKey(): SecretKey!
Gets the SecretKey
from this entry.
Return |
SecretKey! |
the SecretKey from this entry |
toString
fun toString(): String
Returns a string representation of this SecretKeyEntry.
Return |
String |
a string representation of this SecretKeyEntry. |
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.
[[["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 2025-02-10 UTC."],[],[],null,["# KeyStore.SecretKeyEntry\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nSecretKeyEntry\n==============\n\n```\nclass SecretKeyEntry : KeyStore.Entry\n```\n\n|---|--------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [java.security.KeyStore.SecretKeyEntry](#) |\n\nA `KeyStore` entry that holds a `SecretKey`.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [SecretKeyEntry](#SecretKeyEntry(javax.crypto.SecretKey))`(`secretKey:` `[SecretKey](../../javax/crypto/SecretKey.html#)!`)` Constructs a `SecretKeyEntry` with a `SecretKey`. |\n| [SecretKeyEntry](#SecretKeyEntry(javax.crypto.SecretKey,%20kotlin.collections.MutableSet))`(`secretKey:` `[SecretKey](../../javax/crypto/SecretKey.html#)!`, `attributes:` `[MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\u003c[KeyStore.Entry.Attribute](/reference/kotlin/java/security/KeyStore.Entry.Attribute)!\u003e!`)` Constructs a `SecretKeyEntry` with a `SecretKey` and associated entry attributes. |\n\n| Public methods ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|\n| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\\\u003c[KeyStore.Entry.Attribute](/reference/kotlin/java/security/KeyStore.Entry.Attribute)!\\\u003e! | [getAttributes](#getAttributes())`()` Retrieves the attributes associated with an entry. |\n| [SecretKey](../../javax/crypto/SecretKey.html#)! | [getSecretKey](#getSecretKey())`()` Gets the `SecretKey` from this entry. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` Returns a string representation of this SecretKeyEntry. |\n\nPublic constructors\n-------------------\n\n### SecretKeyEntry\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nSecretKeyEntry(secretKey: SecretKey!)\n```\n\nConstructs a `SecretKeyEntry` with a `SecretKey`.\n\n| Parameters ||\n|-------------|-------------------------------------------------------------------|\n| `secretKey` | [SecretKey](../../javax/crypto/SecretKey.html#)!: the `SecretKey` |\n\n| Exceptions ||\n|----------------------------------|--------------------------|\n| `java.lang.NullPointerException` | if `secretKey` is `null` |\n\n### SecretKeyEntry\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nSecretKeyEntry(\n secretKey: SecretKey!, \n attributes: MutableSet\u003cKeyStore.Entry.Attribute!\u003e!)\n```\n\nConstructs a `SecretKeyEntry` with a `SecretKey` and associated entry attributes.\n\nThe specified `attributes` is cloned before it is stored in the new `SecretKeyEntry` object.\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `secretKey` | [SecretKey](../../javax/crypto/SecretKey.html#)!: the `SecretKey` |\n| `attributes` | [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\\\u003c[KeyStore.Entry.Attribute](/reference/kotlin/java/security/KeyStore.Entry.Attribute)!\\\u003e!: the attributes |\n\n| Exceptions ||\n|----------------------------------|------------------------------------------|\n| `java.lang.NullPointerException` | if `secretKey` or `attributes` is `null` |\n\nPublic methods\n--------------\n\n### getAttributes\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getAttributes(): MutableSet\u003cKeyStore.Entry.Attribute!\u003e!\n```\n\nRetrieves the attributes associated with an entry.\n\n| Return ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|\n| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\u003c[KeyStore.Entry.Attribute](/reference/kotlin/java/security/KeyStore.Entry.Attribute)!\u003e! | an unmodifiable `Set` of attributes, possibly empty |\n\n### getSecretKey\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getSecretKey(): SecretKey!\n```\n\nGets the `SecretKey` from this entry.\n\n| Return ||\n|--------------------------------------------------|---------------------------------|\n| [SecretKey](../../javax/crypto/SecretKey.html#)! | the `SecretKey` from this entry |\n\n### toString\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\nReturns a string representation of this SecretKeyEntry.\n\n| Return ||\n|----------------------------------------------------------------------------------|-------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of this SecretKeyEntry. |"]]