EncryptedTopic


class EncryptedTopic
kotlin.Any
   ↳ android.adservices.topics.EncryptedTopic

Encrypted form of android.adservices.topics.Topic. This object will be used to return encrypted topic cipher text along with necessary fields required to decrypt it.

Decryption of EncryptedTopic#getEncryptedTopic() should give json string for Topic. Example of decrypted json string: { "taxonomy_version": 5, "model_version": 2, "topic_id": 10010 }

Decryption of cipher text is expected to happen on the server with the corresponding algorithm and private key for the public key EncryptedTopic#getKeyIdentifier()}.

Detailed steps on decryption can be found on Developer Guide.

Summary

Public constructors
EncryptedTopic(encryptedTopic: ByteArray, keyIdentifier: String, encapsulatedKey: ByteArray)

Creates encrypted version of the Topic object.

Public methods
Boolean
equals(other: Any?)

ByteArray

Returns the encapsulated key generated during HPKE setup.

ByteArray

Returns encrypted bytes for the JSON version of the Topic object as cipher text.

String

Returns key identifier for the used encryption key.

Int

String

Public constructors

EncryptedTopic

EncryptedTopic(
    encryptedTopic: ByteArray,
    keyIdentifier: String,
    encapsulatedKey: ByteArray)

Creates encrypted version of the Topic object.

Parameters
encryptedTopic ByteArray: byte array cipher text containing encrypted Topic json string. This value cannot be null.
keyIdentifier String: key used to identify the public key used for encryption. This value cannot be null.
encapsulatedKey ByteArray: encapsulated key generated during HPKE setup. This value cannot be null.

Public methods

equals

Added in API level 35
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getEncapsulatedKey

fun getEncapsulatedKey(): ByteArray

Returns the encapsulated key generated during HPKE setup.

Return
ByteArray This value cannot be null.

getEncryptedTopic

fun getEncryptedTopic(): ByteArray

Returns encrypted bytes for the JSON version of the Topic object as cipher text.

Return
ByteArray This value cannot be null.

getKeyIdentifier

fun getKeyIdentifier(): String

Returns key identifier for the used encryption key.

Return
String This value cannot be null.

hashCode

Added in API level 35
fun hashCode(): Int
Return
Int a hash code value for this object.

toString

Added in API level 35
fun toString(): String
Return
String a string representation of the object.