pin

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPinLength = errors.New("libiso: Invalid PIN length (cannot exceed 12)")

Functions

func DecryptPinBlock

func DecryptPinBlock(pinBlock []byte, key []byte) (result []byte, err error)

DecryptPinBlock decrypts a new PIN block

func EncryptPinBlock

func EncryptPinBlock(pinBlock []byte, key []byte) (result []byte, err error)

EncryptPinBlock encrypts a new pin block

Types

type PinBlock_Iso0

type PinBlock_Iso0 struct {
	PinBlocker
}

func (*PinBlock_Iso0) Encrypt

func (pinBlock *PinBlock_Iso0) Encrypt(pan string, clearPin string, key []byte) ([]byte, error)

func (*PinBlock_Iso0) GetPin

func (pinBlock *PinBlock_Iso0) GetPin(pan string, pinBlockData []byte, key []byte) (res string, err error)

type PinBlocker

type PinBlocker interface {
	Encrypt(pan string, clearPin string, key []byte) ([]byte, error)
	GetPin(pan string, pinBlockData []byte, key []byte) (string, error)
}

PinBlocker represents a interface for types that can decrypt or encrypt a PIN block

type PinblockIbm3264

type PinblockIbm3264 struct {
	PinBlocker
}

func (*PinblockIbm3264) Encrypt

func (pinBlock *PinblockIbm3264) Encrypt(pan string, clearPin string, key []byte) ([]byte, error)

func (*PinblockIbm3264) GetPin

func (pinBlock *PinblockIbm3264) GetPin(pan string, pinBlockData []byte, key []byte) (res string, err error)

type PinblockIso1

type PinblockIso1 struct {
	PinBlocker
}

func (*PinblockIso1) Encrypt

func (pinBlock *PinblockIso1) Encrypt(pan string, clearPin string, key []byte) (res []byte, err error)

func (*PinblockIso1) GetPin

func (pinBlock *PinblockIso1) GetPin(pan string, pinBlockData []byte, key []byte) (res string, err error)

type PinblockIso3

type PinblockIso3 struct {
	PinBlocker
}

func (*PinblockIso3) Encrypt

func (pinBlock *PinblockIso3) Encrypt(pan string, clearPin string, key []byte) (res []byte, err error)

func (*PinblockIso3) GetPin

func (pinBlock *PinblockIso3) GetPin(pan string, pinBlockData []byte, key []byte) (res string, err error)

Jump to

Keyboard shortcuts

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