Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/java/security/KeyStore.TrustedCertificateEntry#pubctors) \| [Methods](https://developer.android.com/reference/java/security/KeyStore.TrustedCertificateEntry#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/security/KeyStore.TrustedCertificateEntry#inhmethods)

# KeyStore.TrustedCertificateEntry

` public static final class KeyStore.TrustedCertificateEntry `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/java/security/KeyStore.Entry `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.security.KeyStore.TrustedCertificateEntry |

<br />

*** ** * ** ***

A `KeyStore` entry that holds a trusted `Certificate`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/java/security/KeyStore.TrustedCertificateEntry#TrustedCertificateEntry(java.security.cert.Certificate)(https://developer.android.com/reference/java/security/cert/Certificate trustedCert) ` Constructs a `TrustedCertificateEntry` with a trusted `Certificate`. |
| ` https://developer.android.com/reference/java/security/KeyStore.TrustedCertificateEntry#TrustedCertificateEntry(java.security.cert.Certificate,%20java.util.Set<java.security.KeyStore.Entry.Attribute>)(https://developer.android.com/reference/java/security/cert/Certificate trustedCert, https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/security/KeyStore.Entry.Attribute> attributes) ` Constructs a `TrustedCertificateEntry` with a trusted `Certificate` and associated entry attributes. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/security/KeyStore.Entry.Attribute>` | ` https://developer.android.com/reference/java/security/KeyStore.TrustedCertificateEntry#getAttributes()() ` Retrieves the attributes associated with an entry. |
| ` https://developer.android.com/reference/java/security/cert/Certificate` | ` https://developer.android.com/reference/java/security/KeyStore.TrustedCertificateEntry#getTrustedCertificate()() ` Gets the trusted `Certficate` from this entry. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/security/KeyStore.TrustedCertificateEntry#toString()() ` Returns a string representation of this TrustedCertificateEntry. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/java/security/KeyStore.Entry ` ` default https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/security/KeyStore.Entry.Attribute>` ` https://developer.android.com/reference/java/security/KeyStore.Entry#getAttributes()() `

Retrieves the attributes associated with an entry.

## Public constructors

### TrustedCertificateEntry

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TrustedCertificateEntry (Certificate trustedCert)
```

Constructs a `TrustedCertificateEntry` with a trusted `Certificate`.

<br />

| Parameters ||
|---|---|
| `trustedCert` | `Certificate`: the trusted `Certificate` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `trustedCert` is `null` |

### TrustedCertificateEntry

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TrustedCertificateEntry (Certificate trustedCert, 
                Set<KeyStore.Entry.Attribute> attributes)
```

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.

<br />

| Parameters ||
|---|---|
| `trustedCert` | `Certificate`: the trusted `Certificate` <br /> |
| `attributes` | `Set`: the attributes <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `trustedCert` or `attributes` is `null` |

## Public methods

### getAttributes

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<KeyStore.Entry.Attribute> getAttributes ()
```

Retrieves the attributes associated with an entry.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/security/KeyStore.Entry.Attribute>` | an unmodifiable `Set` of attributes, possibly empty <br /> |

### getTrustedCertificate

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Certificate getTrustedCertificate ()
```

Gets the trusted `Certficate` from this entry.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/security/cert/Certificate` | the trusted `Certificate` from this entry <br /> |

### toString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of this TrustedCertificateEntry.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of this TrustedCertificateEntry. <br /> |