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