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

fun equals(other: Any?): Boolean

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

fun hashCode(): Int

toString

fun toString(): String