Documentation
¶
Index ¶
Constants ¶
View Source
const ALGORITHM = "SHA256"
View Source
const CURVE = "NIST_P256"
View Source
const ENCODING = "DER"
View Source
const FORMAT = "UNCOMPRESSED"
View Source
const SENDER = "Google"
Variables ¶
View Source
var ( ErrRootKeys = errors.New("an error is occured while filtering root keys") ErrParseJson = errors.New("cannot find ECv2 in parsed jsonfile") ErrProtocolV = errors.New("only ECv2-signed tokens are supported") ErrValidateTime = errors.New("failed checking expiration date") ErrPrivateKey = errors.New("failed loading private key") ErrPublicKey = errors.New("failed loading public key") ErrTyping = errors.New("error while typing") ErrVerifySignature = errors.New("could not verify intermediate signing key signature") ErrLengthDoesnotMatch = errors.New("length of key does not match") ErrLoadingKeys = errors.New("please call Init() function to initialize keys") )
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
Name string `json:"name,omitempty"`
PostalCode string `json:"postalCode,omitempty"`
CountryCode string `json:"countryCode,omitempty"`
PhoneNumber string `json:"phoneNumber,omitempty"`
Address1 string `json:"address1,omitempty"`
Address2 string `json:"address2,omitempty"`
Address3 string `json:"address3,omitempty"`
Locality string `json:"locality,omitempty"`
AdministrativeArea string `json:"administrativeArea,omitempty"`
SortingCode string `json:"sortingCode,omitempty"`
}
type AssuranceDetails ¶
type Decrypted ¶
type Decrypted struct {
MessageExpiration string `json:"messageExpiration"`
MessageId string `json:"messageId"`
PaymentMethod string `json:"paymentMethod"`
PaymentMethodDetails PaymentMethodDetails `json:"paymentMethodDetails"`
}
type IntermediateSigningKey ¶
type IntermediateSigningKey struct {
SignedKey string `json:"signedKey" binding:"required"`
Signatures []string `json:"signatures" binding:"required"`
}
func (*IntermediateSigningKey) UnmarshalSignedKey ¶
func (t *IntermediateSigningKey) UnmarshalSignedKey(s string) (result SignedKey, err error)
type PaymentMethodDetails ¶
type PaymentMethodDetails struct {
AssuranceDetails *AssuranceDetails `json:"assuranceDetails,omitempty"`
BillingAddress *Address `json:"billingAddress,omitempty"`
CardDetails string `json:"cardDetails,omitempty"`
CardNetwork string `json:"cardNetwork,omitempty"`
Pan string `json:"pan"`
ExpirationMonth int `json:"expirationMonth"`
ExpirationYear int `json:"expirationYear"`
AuthMethod string `json:"authMethod"`
Cryptogram string `json:"cryptogram,omitempty"`
EciIndicator string `json:"eciIndicator,omitempty"`
}
type RootSigningKey ¶
type RootSigningKey struct {
RootKeys []RootKeys `json:"keys"`
}
type SignedMessage ¶
type Token ¶
type Token struct {
ProtocolVersion string `json:"protocolVersion" binding:"required"`
Signature string `json:"signature" binding:"required"`
IntermediateSigningKey IntermediateSigningKey `json:"intermediateSigningKey" binding:"required"`
SignedMessage string `json:"signedMessage" binding:"required"`
}
func (*Token) UnmarshalSignedMessage ¶
func (t *Token) UnmarshalSignedMessage(s string) (result SignedMessage, err error)
Click to show internal directories.
Click to hide internal directories.