decrypt

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(base64PublicKey string) ([]byte, error)

func CheckTime

func CheckTime(exp string) bool

func ConstructSignature

func ConstructSignature(params ...string) []byte

func Decode

func Decode(encryptionKey []byte, encryptedData string) ([]byte, error)

func DeriveKeys

func DeriveKeys(token types.Token, privateKeyEncoded string) ([]byte, []byte, error)

func GenerateMacKeyAndEncryptionKey

func GenerateMacKeyAndEncryptionKey(sharedSecret []byte) ([]byte, []byte, error)

func Init

func Init(rootKeys []byte, recipientId string, privateKey string)

func VerifyMessageHmac

func VerifyMessageHmac(macKey []byte, tag string, encryptedMessage string) error

func VerifySignature

func VerifySignature(token types.Token, keyValues []string, receipientId string) error

Types

type GooglePayDecryptor

type GooglePayDecryptor struct {
	// contains filtered or unexported fields
}

func New added in v0.1.3

func New(rootKeys []byte, recipientId string, privateKey string) *GooglePayDecryptor

func NewGooglePayDecryptor

func NewGooglePayDecryptor() (*GooglePayDecryptor, error)

func (*GooglePayDecryptor) Decrypt

func (g *GooglePayDecryptor) Decrypt(token types.Token) (types.Decrypted, error)

type PrivateKey

type PrivateKey struct{}

func (*PrivateKey) LoadKey

func (p *PrivateKey) LoadKey(privateKey string) (*subtle.ECPrivateKey, error)

type PublicKey

type PublicKey struct{}

func (*PublicKey) LoadEphemeralPublicKey

func (pk *PublicKey) LoadEphemeralPublicKey(base64PublicKey string) (*subtle.ECPoint, error)

func (*PublicKey) LoadPublicKey

func (pk *PublicKey) LoadPublicKey(base64PublicKey string) (*ecdsa.PublicKey, error)

type RootSigningKey

type RootSigningKey struct{}

func (*RootSigningKey) Filter

func (r *RootSigningKey) Filter(rootKeys []byte) (types.RootKeys, []string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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