Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ApplePublicKey is Apple's public key for SkAdNetwork postback verification. ApplePublicKey = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWdp8GPcGqmhgzEFj9Z2nSpQVddayaPe4FMzqM9wib1+aHaaIzoHoLN9zW4K8y4SPykE3YVK3sVqW6Af0lfx3gg==" // AppleDelimiter is the delimiter used for joining parameters AppleDelimiter = "\u2063" )
View Source
const (
// ApplePublicKeyLegacy has been deprecated by Apple, but can be used for verifying postbacks versions 1.0 and 2.0.
ApplePublicKeyLegacy = "MEkwEwYHKoZIzj0CAQYIKoZIzj0DAQEDMgAEMyHD625uvsmGq4C43cQ9BnfN2xslVT5V1nOmAMP6qaRRUll3PB1JYmgSm+62sosG"
)
Variables ¶
View Source
var ( // ErrorInvalidData indicates input data is invalid ErrorInvalidData = errors.New("invalid data") // ErrorSignatureMismatch indicates signature did not match input data ErrorSignatureMismatch = errors.New("signature mismatch") )
Functions ¶
This section is empty.
Types ¶
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier verifies that a given postback data matches its signature
func NewLegacyVerifier ¶
func NewLegacyVerifier() *Verifier
NewLegacyVerifier can be used for postbacks versions 1.0 and 2.0. Google's certificate-transparency-go does not work with ApplePublicKeyLegacy but we can create it manually.
func NewVerifier ¶
func NewVerifier() *Verifier
NewVerifier is used to create an instance of Verifier for postback versions 2.1 and later.
func (*Verifier) VerifySignature ¶
VerifySignature verifies a given postback data and signature The parameter data is expected to be a byte array. If string array is given, the function will use the correct delimiter to create the byte array needed to verify the signature against.
Click to show internal directories.
Click to hide internal directories.