public class KeymasterArguments extends Object implements Parcelable
Serialization code for this and subclasses must be kept in sync with system/security/keystore
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<KeymasterArguments> |
CREATOR |
static long |
UINT32_MAX_VALUE |
static BigInteger |
UINT64_MAX_VALUE |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
KeymasterArguments() |
Modifier and Type | Method and Description |
---|---|
void |
addBoolean(int tag)
Adds the provided boolean tag.
|
void |
addBytes(int tag,
byte[] value)
Adds a bytes tag with the provided value.
|
void |
addDate(int tag,
Date value)
Adds a date tag with the provided value.
|
void |
addDateIfNotNull(int tag,
Date value)
Adds a date tag with the provided value, if the value is not
null . |
void |
addEnum(int tag,
int value)
Adds an enum tag with the provided value.
|
void |
addEnums(int tag,
int... values)
Adds a repeated enum tag with the provided values.
|
void |
addUnsignedInt(int tag,
long value)
Adds an unsigned 32-bit int tag with the provided value.
|
void |
addUnsignedLong(int tag,
BigInteger value)
Adds an unsigned 64-bit long tag with the provided value.
|
boolean |
containsTag(int tag) |
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
boolean |
getBoolean(int tag)
Returns
true if the provided boolean tag is present, false if absent. |
byte[] |
getBytes(int tag,
byte[] defaultValue)
Returns the value of the specified bytes tag or
defaultValue if the tag is not
present. |
Date |
getDate(int tag,
Date defaultValue)
Returns the value of the specified date tag or
defaultValue if the tag is not
present. |
int |
getEnum(int tag,
int defaultValue)
Returns the value of the specified enum tag or
defaultValue if the tag is not
present. |
List<Integer> |
getEnums(int tag)
Returns all values of the specified repeating enum tag.
|
long |
getUnsignedInt(int tag,
long defaultValue)
Returns the value of the specified unsigned 32-bit int tag or
defaultValue if the tag
is not present. |
List<BigInteger> |
getUnsignedLongs(int tag)
Returns all values of the specified repeating unsigned 64-bit long tag.
|
void |
readFromParcel(Parcel in) |
int |
size() |
static BigInteger |
toUint64(long value)
Converts the provided value to non-negative
BigInteger , treating the sign bit of the
provided value as the most significant bit of the result. |
void |
writeToParcel(Parcel out,
int flags)
Flatten this object in to a Parcel.
|
public static final long UINT32_MAX_VALUE
public static final BigInteger UINT64_MAX_VALUE
public static final Parcelable.Creator<KeymasterArguments> CREATOR
public void addEnum(int tag, int value)
IllegalArgumentException
- if tag
is not an enum tag.public void addEnums(int tag, int... values)
IllegalArgumentException
- if tag
is not a repeating enum tag.public int getEnum(int tag, int defaultValue)
defaultValue
if the tag is not
present.IllegalArgumentException
- if tag
is not an enum tag.public List<Integer> getEnums(int tag)
tag
is not a repeating enum tag.public void addUnsignedInt(int tag, long value)
IllegalArgumentException
- if tag
is not an unsigned 32-bit int tag or if
value
is outside of the permitted range [0; 2^32).public long getUnsignedInt(int tag, long defaultValue)
defaultValue
if the tag
is not present.IllegalArgumentException
- if tag
is not an unsigned 32-bit int tag.public void addUnsignedLong(int tag, BigInteger value)
IllegalArgumentException
- if tag
is not an unsigned 64-bit long tag or if
value
is outside of the permitted range [0; 2^64).public List<BigInteger> getUnsignedLongs(int tag)
IllegalArgumentException
- if tag
is not a repeating unsigned 64-bit long tag.public void addBoolean(int tag)
true
if
present and false
if absent.IllegalArgumentException
- if tag
is not a boolean tag.public boolean getBoolean(int tag)
true
if the provided boolean tag is present, false
if absent.IllegalArgumentException
- if tag
is not a boolean tag.public void addBytes(int tag, byte[] value)
IllegalArgumentException
- if tag
is not a bytes tag.public byte[] getBytes(int tag, byte[] defaultValue)
defaultValue
if the tag is not
present.IllegalArgumentException
- if tag
is not a bytes tag.public void addDate(int tag, Date value)
IllegalArgumentException
- if tag
is not a date tag or if value
is
before the start of Unix epoch.public void addDateIfNotNull(int tag, Date value)
null
. Does nothing if
the value
is null.IllegalArgumentException
- if tag
is not a date tag or if value
is
before the start of Unix epoch.public Date getDate(int tag, Date defaultValue)
defaultValue
if the tag is not
present.IllegalArgumentException
- if tag
is not a date tag or if the tag's value
represents a time instant which is after 2^63 - 1
milliseconds since Unix
epoch.public boolean containsTag(int tag)
public int size()
public void writeToParcel(Parcel out, int flags)
Parcelable
writeToParcel
in interface Parcelable
out
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public void readFromParcel(Parcel in)
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public static BigInteger toUint64(long value)
BigInteger
, treating the sign bit of the
provided value as the most significant bit of the result.