public class ContainerEncryptionParams extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<ContainerEncryptionParams> |
CREATOR |
protected static String |
TAG |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
ContainerEncryptionParams(String encryptionAlgorithm,
AlgorithmParameterSpec encryptionSpec,
SecretKey encryptionKey) |
ContainerEncryptionParams(String encryptionAlgorithm,
AlgorithmParameterSpec encryptionSpec,
SecretKey encryptionKey,
String macAlgorithm,
AlgorithmParameterSpec macSpec,
SecretKey macKey,
byte[] macTag,
long authenticatedDataStart,
long encryptedDataStart,
long dataEnd)
Creates container encryption specifications for installing from encrypted
containers.
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
boolean |
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
long |
getAuthenticatedDataStart() |
long |
getDataEnd() |
long |
getEncryptedDataStart() |
String |
getEncryptionAlgorithm() |
SecretKey |
getEncryptionKey() |
AlgorithmParameterSpec |
getEncryptionSpec() |
String |
getMacAlgorithm() |
SecretKey |
getMacKey() |
AlgorithmParameterSpec |
getMacSpec() |
byte[] |
getMacTag() |
int |
hashCode()
Returns an integer hash code for this object.
|
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
protected static final String TAG
public static final Parcelable.Creator<ContainerEncryptionParams> CREATOR
public ContainerEncryptionParams(String encryptionAlgorithm, AlgorithmParameterSpec encryptionSpec, SecretKey encryptionKey) throws InvalidAlgorithmParameterException
public ContainerEncryptionParams(String encryptionAlgorithm, AlgorithmParameterSpec encryptionSpec, SecretKey encryptionKey, String macAlgorithm, AlgorithmParameterSpec macSpec, SecretKey macKey, byte[] macTag, long authenticatedDataStart, long encryptedDataStart, long dataEnd) throws InvalidAlgorithmParameterException
encryptionAlgorithm
- encryption algorithm to use; format matches
JCEencryptionSpec
- algorithm parameter specificationencryptionKey
- key used for decryptionmacAlgorithm
- MAC algorithm to use; format matches JCEmacSpec
- algorithm parameters specification, may be null
macKey
- key used for authentication (i.e., for the MAC tag)macTag
- message authentication code (MAC) tag for the authenticated
dataauthenticatedDataStart
- offset of start of authenticated data in
streamencryptedDataStart
- offset of start of encrypted data in streamdataEnd
- offset of the end of both the authenticated and encrypted
dataInvalidAlgorithmParameterException
public String getEncryptionAlgorithm()
public AlgorithmParameterSpec getEncryptionSpec()
public SecretKey getEncryptionKey()
public String getMacAlgorithm()
public AlgorithmParameterSpec getMacSpec()
public SecretKey getMacKey()
public byte[] getMacTag()
public long getAuthenticatedDataStart()
public long getEncryptedDataStart()
public long getDataEnd()
public int describeContents()
Parcelable
describeContents
in interface Parcelable
public boolean equals(Object o)
Object
o
must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be reflexive, symmetric, and transitive.
Also, no object reference other than null is equal to null.
The default implementation returns true
only if this ==
o
. See Writing a correct
equals
method
if you intend implementing your own equals
method.
The general contract for the equals
and Object.hashCode()
methods is that if equals
returns true
for
any two objects, then hashCode()
must return the same value for
these objects. This means that subclasses of Object
usually
override either both methods or neither of them.
equals
in class Object
o
- the object to compare this instance with.true
if the specified object is equal to this Object
; false
otherwise.Object.hashCode()
public int hashCode()
Object
Object.equals(java.lang.Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode
method
if you intend implementing your own hashCode
method.
hashCode
in class Object
Object.equals(java.lang.Object)
public String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- 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
.