public final class

PersonalizationData.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.security.identity.PersonalizationData.Builder

Overview

A builder for PersonalizationData.

Summary

Constructors
publicBuilder()

Creates a new builder for a given namespace.

Methods
public PersonalizationData.BuilderaddAccessControlProfile(AccessControlProfile profile)

Adds a new access control profile to the builder.

public PersonalizationDatabuild()

Creates a new PersonalizationData with all the entries added to the builder.

public PersonalizationData.BuilderputEntry(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, byte[] value[])

Adds a new entry to the builder.

public PersonalizationData.BuilderputEntryBoolean(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, boolean value)

Adds a new entry to the builder.

public PersonalizationData.BuilderputEntryBytestring(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, byte[] value[])

Adds a new entry to the builder.

public PersonalizationData.BuilderputEntryCalendar(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, Calendar value)

Adds a new entry to the builder.

public PersonalizationData.BuilderputEntryInteger(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, long value)

Adds a new entry to the builder.

public PersonalizationData.BuilderputEntryString(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, java.lang.String value)

Adds a new entry to the builder.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Creates a new builder for a given namespace.

Methods

public PersonalizationData.Builder putEntry(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, byte[] value[])

Adds a new entry to the builder.

This is a low-level method which expects the data to be the bytes of a CBOR value. When possible, applications should use methods such as PersonalizationData.Builder.putEntryString(String, String, Collection, String) or PersonalizationData.Builder.putEntryInteger(String, String, Collection, long) which accept normal Java data types.

Parameters:

namespace: The namespace to use, e.g. org.iso.18013-5.2019.
name: The name of the entry, e.g. height.
accessControlProfileIds: A set of access control profiles to use.
value: The value to add, in CBOR encoding.

Returns:

The builder.

public PersonalizationData.Builder putEntryString(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, java.lang.String value)

Adds a new entry to the builder.

This is a convenience method which encodes value as CBOR and adds the resulting bytes using PersonalizationData.Builder.putEntry(String, String, Collection, byte[]). The resulting CBOR will be major type 3 (text string).

Parameters:

namespace: The namespace to use, e.g. org.iso.18013-5.2019.
name: The name of the entry, e.g. height.
accessControlProfileIds: A set of access control profiles to use.
value: The value to add.

Returns:

The builder.

public PersonalizationData.Builder putEntryBytestring(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, byte[] value[])

Adds a new entry to the builder.

This is a convenience method which encodes value as CBOR and adds the resulting bytes using PersonalizationData.Builder.putEntry(String, String, Collection, byte[]). The resulting CBOR will be major type 2 (bytestring).

Parameters:

namespace: The namespace to use, e.g. org.iso.18013-5.2019.
name: The name of the entry, e.g. height.
accessControlProfileIds: A set of access control profiles to use.
value: The value to add.

Returns:

The builder.

public PersonalizationData.Builder putEntryInteger(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, long value)

Adds a new entry to the builder.

This is a convenience method which encodes value as CBOR and adds the resulting bytes using PersonalizationData.Builder.putEntry(String, String, Collection, byte[]). The resulting CBOR will be major type 0 (unsigned integer) if non-negative, otherwise major type 1 (negative integer).

Parameters:

namespace: The namespace to use, e.g. org.iso.18013-5.2019.
name: The name of the entry, e.g. height.
accessControlProfileIds: A set of access control profiles to use.
value: The value to add.

Returns:

The builder.

public PersonalizationData.Builder putEntryBoolean(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, boolean value)

Adds a new entry to the builder.

This is a convenience method which encodes value as CBOR and adds the resulting bytes using PersonalizationData.Builder.putEntry(String, String, Collection, byte[]). The resulting CBOR will be major type 7 (simple value) with additional information 20 (for the value false) or 21 (for the value true).

Parameters:

namespace: The namespace to use, e.g. org.iso.18013-5.2019.
name: The name of the entry, e.g. height.
accessControlProfileIds: A set of access control profiles to use.
value: The value to add.

Returns:

The builder.

public PersonalizationData.Builder putEntryCalendar(java.lang.String namespace, java.lang.String name, java.util.Collection<AccessControlProfileId> accessControlProfileIds, Calendar value)

Adds a new entry to the builder.

This is a convenience method which encodes value as CBOR and adds the resulting bytes using PersonalizationData.Builder.putEntry(String, String, Collection, byte[]). The resulting CBOR will be a tagged string with tag 0 as per Section 2.4.1 of RFC 7049. This means that the tagged string follows the standard format described in RFC 3339, as refined by Section 3.3 of RFC 4287>.

Parameters:

namespace: The namespace to use, e.g. org.iso.18013-5.2019.
name: The name of the entry, e.g. height.
accessControlProfileIds: A set of access control profiles to use.
value: The value to add.

Returns:

The builder.

public PersonalizationData.Builder addAccessControlProfile(AccessControlProfile profile)

Adds a new access control profile to the builder.

Parameters:

profile: The access control profile.

Returns:

The builder.

public PersonalizationData build()

Creates a new PersonalizationData with all the entries added to the builder.

Returns:

A new PersonalizationData instance.