Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
37.2](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder#inhmethods)

# AccessControlProfile.Builder

*** ** * ** ***


`
public
static
final

class
AccessControlProfile.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.security.identity.AccessControlProfile.Builder |

<br />

*** ** * ** ***


**This class was deprecated
in API level 37.2.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

A builder for `https://developer.android.com/reference/android/security/identity/AccessControlProfile`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder#Builder(android.security.identity.AccessControlProfileId)(https://developer.android.com/reference/android/security/identity/AccessControlProfileId accessControlProfileId) ` *This constructor is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/security/identity/AccessControlProfile` | ` https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder#build()() ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| ` https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder` | ` https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder#setReaderCertificate(java.security.cert.X509Certificate)(https://developer.android.com/reference/java/security/cert/X509Certificate readerCertificate) ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| ` https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder` | ` https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder#setUserAuthenticationRequired(boolean)(boolean userAuthenticationRequired) ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |
| ` https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder` | ` https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder#setUserAuthenticationTimeout(long)(long userAuthenticationTimeoutMillis) ` *This method is deprecated. Use `java.security.KeyStore` with the Android hardware-backed keystore instead.* |

### 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*.


## Public constructors

### Builder

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

```
public Builder (AccessControlProfileId accessControlProfileId)
```


**This constructor is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Each access control profile has numeric identifier that must be unique within the
context of a Credential and may be used to reference the profile.

By default, the resulting `https://developer.android.com/reference/android/security/identity/AccessControlProfile` will require user
authentication with a timeout of zero, thus requiring the holder to authenticate for
every presentation where data elements using this access control profile is used.

<br />

<br />

| Parameters ||
|---|---|
| `accessControlProfileId` | `AccessControlProfileId`: the access control profile identifier. This value cannot be `null`. <br /> |

## Public methods

### build

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

```
public AccessControlProfile build ()
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Creates a new `https://developer.android.com/reference/android/security/identity/AccessControlProfile` from the data supplied to the builder.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/security/identity/AccessControlProfile` | The created `https://developer.android.com/reference/android/security/identity/AccessControlProfile` object. This value cannot be `null`. <br /> |

### setReaderCertificate

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

```
public AccessControlProfile.Builder setReaderCertificate (X509Certificate readerCertificate)
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Sets the reader certificate to use when checking access control.

If set, this is checked against the certificate chain presented by
reader. The access check is fulfilled only if one of the certificates
in the chain, matches the certificate set by this method.

<br />

<br />

| Parameters ||
|---|---|
| `readerCertificate` | `X509Certificate`: the certificate to use for the access control check. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder` | The builder. This value cannot be `null`. <br /> |

### setUserAuthenticationRequired

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

```
public AccessControlProfile.Builder setUserAuthenticationRequired (boolean userAuthenticationRequired)
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Set whether user authentication is required.

This should be used sparingly since disabling user authentication on just a single
data element can easily create a
[Relay Attack](https://en.wikipedia.org/wiki/Relay_attack) if the device
on which the credential is stored is compromised.

<br />

<br />

| Parameters ||
|---|---|
| `userAuthenticationRequired` | `boolean`: Set to true if user authentication is required, false otherwise. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder` | The builder. This value cannot be `null`. <br /> |

### setUserAuthenticationTimeout

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

```
public AccessControlProfile.Builder setUserAuthenticationTimeout (long userAuthenticationTimeoutMillis)
```


**This method is deprecated.**   

Use `java.security.KeyStore` with the Android hardware-backed keystore
instead.

Sets the authentication timeout to use.

The authentication timeout specifies the amount of time, in milliseconds, for which a
user authentication is valid, if user authentication is required (see
`https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder#setUserAuthenticationRequired(boolean)`).

If the timeout is zero, then authentication is always required for each reader
session.

<br />

<br />

| Parameters ||
|---|---|
| `userAuthenticationTimeoutMillis` | `long`: the authentication timeout, in milliseconds. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/security/identity/AccessControlProfile.Builder` | The builder. This value cannot be `null`. <br /> |