SignedContextualAds
class SignedContextualAds : Parcelable
Contains a list of buyer supplied AdWithBid
bundle and its signature.
Instances of this class are created by SDKs to be injected as part of AdSelectionConfig
and passed to android.adservices.adselection.AdSelectionManager#selectAds
SignedContextualAds are signed using ECDSA algorithm with SHA256 hashing algorithm (aka SHA256withECDSA). Keys used should belong to P-256 curve (aka “secp256r1” or “prime256v1”).
Signature should include the buyer, decisionLogicUri and adsWithBid fields.
While creating the signature a specific serialization rules must be followed as it's outlined here:
Objects
concatenate the serialized values of their fields with the |
(pipe) in between each field
All fields
are sorted by alphabetical order within the object
Nullable fields
are skipped if they are null/unset
Doubles
are converted to String preserving precision
Integers
are converted to string values
Sets
are sorted alphabetically
Lists
keep the same order
Strings
get encoded into byte[] using UTF-8 encoding
Summary
Inherited constants |
From class Parcelable
Int |
CONTENTS_FILE_DESCRIPTOR
Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor.
|
Int |
PARCELABLE_WRITE_RETURN_VALUE
Flag for use with writeToParcel : the object being written is a return value, that is the result of a function such as "Parcelable someFunction() ", "void someFunction(out Parcelable) ", or "void someFunction(inout Parcelable) ". Some implementations may want to release resources at this point.
|
|
Public methods
describeContents
fun describeContents(): Int
equals
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. |
getBuyer
fun getBuyer(): AdTechIdentifier
Return |
AdTechIdentifier |
the Ad tech identifier from which this contextual Ad would have been downloaded This value cannot be null . |
getDecisionLogicUri
fun getDecisionLogicUri(): Uri
Return |
Uri |
the URI used to retrieve the updateBid() and reportWin() function used during the ad selection and reporting process This value cannot be null . |
getSignature
fun getSignature(): ByteArray
Returns a copy of the signature for the contextual ads object.
See SignedContextualAds
for more details.
Return |
ByteArray |
the signature This value cannot be null . |
hashCode
fun hashCode(): Int
Return |
Int |
a hash code value for this object. |
toString
fun toString(): String
Return |
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
Properties