types

package
v0.0.0-...-07b5f51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 2 Imported by: 0

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 AssuranceDetails struct {
	AccountVerified         bool `json:"accountVerified,omitempty"`
	CardHolderAuthenticated bool `json:"cardHolderAuthenticated"`
}

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 RootKeys

type RootKeys struct {
	KeyValue        string `json:"keyValue"`
	ProtocolVersion string `json:"protocolVersion"`
	KeyExpiration   string `json:"keyExpiration"`
}

type RootSigningKey

type RootSigningKey struct {
	RootKeys []RootKeys `json:"keys"`
}

type SignedKey

type SignedKey struct {
	KeyValue      string `json:"keyValue" binding:"required"`
	KeyExpiration string `json:"keyExpiration" binding:"required"`
}

type SignedMessage

type SignedMessage struct {
	EncryptedMessage   string `json:"encryptedMessage" binding:"required"`
	EphemeralPublicKey string `json:"ephemeralPublicKey" binding:"required"`
	Tag                string `json:"tag" binding:"required"`
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL