Documentation
¶
Overview ¶
Package doubleclick implements the decryption logic for Google OpenRTB-DoubleClick cryptography.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidPrice is the error returned when the price parsed // by DecryptPrice is not correct. ErrInvalidPrice = errors.New("price is invalid") // ErrInvalidKeys is the error returned when the keys are not // valid. ErrInvalidKeys = errors.New("invalid keys") // ErrInvalidIV is the error returned when the initialization // vector is not valid. ErrInvalidIV = errors.New("invalid initialization vector") )
Functions ¶
func DecryptPrice ¶
DecryptPrice decrypts the price with google's doubleclick cryptography encoding. encPrice is an unpadded web-safe base64 encoded string according to RFC 3548. https://developers.google.com/authorized-buyers/rtb/response-guide/decrypt-price#decryption_scheme
func EncryptPrice ¶
EncryptPrice encrypts the price using the provided initialization vector and keys. It encodes the price into a binary array using binary.BigEndian. This function implements the encrypting logic as defined here: https://developers.google.com/authorized-buyers/rtb/response-guide/decrypt-price#encryption-scheme
func ParseKeys ¶
ParseKeys parses the base64 web-safe encoded keys as explained in Google's documentation: https://developers.google.com/authorized-buyers/rtb/response-guide/decrypt-price It receives a base64 encoding object since I've noticed some inconsistencies on Google's documentation and the keys they provide to Ad buyers. If you are following Google's website examples then use `base64.URLEncoding`.
Types ¶
This section is empty.