Documentation ¶
Index ¶
- Constants
- func Expand(input []byte) (string, error)
- func NumericOnly(s string) bool
- func Pack(input string, name InputName) (string, error)
- func XOR(i1, i2 []byte) []byte
- type AESOperation
- type BERTLVParser
- type BERTLVTag
- type Base64Operation
- type CVVOperation
- type CVVResult
- type CipherMode
- type DESOperation
- type Direction
- type EMVDictionary
- type HMACOperation
- type HashMode
- type HashOperation
- type InputName
- type LuhnOperation
- type Mode
- type Operation
- type PINBlockFormat
- type PINBlockOperation
- type PINBlockResult
- type PINOffsetOperation
- type PINOffsetResult
- type PVVOperation
- type RSAOperation
- type RetailMACOperation
- type RetailMACPaddingMode
- type SafeNetVariantOperation
- type XOROperation
Constants ¶
const ( PINBlockFormatISO0 PINBlockFormat = "ISO0" PINBlockFormatISO1 = "ISO1" PINBlockFormatISO2 = "ISO2" PINBlockFormatISO3 = "ISO3" )
PINBlockFormat enum lists supports PIN block formats
const ( RetailMACPaddingModeNone RetailMACPaddingMode = "NONE" RetailMACPaddingModeMethod1 = "M1" RetailMACPaddingModeMethod2 = "M2" )
RetailMAC padding modes
const ( HashModeSHA1 HashMode = "SHA-1" HashModeSHA224 = "SHA-224" HashModeSHA256 = "SHA-256" HashModeSHA384 = "SHA-384" HashModeSHA512 = "SHA-512" HashModeMD4 = "MD4" HashModeMD5 = "MD5" )
HashMode modes of of hash function
const ( InputNameCVK InputName = "CVK" InputNameData = "Data" InputNameInput = "Input" InputNameInput1 = "Input 1" InputNameInput2 = "Input 2" InputNameIV = "IV" InputNameKey = "Key" InputNameMasterKey = "Master Key" InputNameModulus = "Modulus" InputNamePPK = "PPK" InputNamePrivateExponent = "Private Exponent" InputNamePublicExponent = "Public Exponent" InputNamePVK = "PVK" InputNameTag = "Tag" InputNameVariant = "Variant" )
InputName enum specifies input element names for error reporting
Variables ¶
This section is empty.
Functions ¶
func NumericOnly ¶
NumericOnly examines the given string and returns true if all bytes are numeric characters
Types ¶
type AESOperation ¶
type AESOperation struct { Direction Direction Mode CipherMode Key string Data string IV string }
AESOperation struct to be populated by the caller
func (AESOperation) Calculate ¶
func (op AESOperation) Calculate() (string, error)
Calculate performs a crypto operation as described in the AESOperation variable, which should be populated by the caller
type BERTLVParser ¶
type BERTLVParser struct {
Input string
}
BERTLVParser struct to be populated by the caller
func (BERTLVParser) Calculate ¶
func (p BERTLVParser) Calculate() (string, error)
Calculate is given a string of BERTLV data and returns the parsed tags
type BERTLVTag ¶
type BERTLVTag struct { Tag string Length int64 MinLength int64 MaxLength int64 Value string Name string Format string Valid bool InvalidReason string }
BERTLVTag struct represents an individual tag
type Base64Operation ¶
Base64Operation struct to be populated and provided by the caller
func (Base64Operation) Calculate ¶
func (op Base64Operation) Calculate() (string, error)
Calculate performs the coding operation as described in the Base64Operation variable, which should be populated by the caller
type CVVOperation ¶
CVVOperation struct to be populated by the caller
func (CVVOperation) Calculate ¶
func (op CVVOperation) Calculate() (string, error)
Calculate generates the CVVs using data prepared in the CVVOperation variable
type CipherMode ¶
type CipherMode string
CipherMode specifies a cipher chaining mode
const ( CipherModeECB CipherMode = "ECB" CipherModeCBC = "CBC" )
CipherMode specifies a cipher chaining mode
type DESOperation ¶
type DESOperation struct { Direction Direction Mode CipherMode Key string Data string IV string }
DESOperation struct to be populated by the caller
func (DESOperation) Calculate ¶
func (op DESOperation) Calculate() (string, error)
Calculate performs a crypto operation as described in the DESOperation varible, which should be populated be the caller
type EMVDictionary ¶
EMVDictionary is supported as a singleton which contains EMV tag info for lookups
func GetDictionary ¶
func GetDictionary() *EMVDictionary
GetDictionary returns a populated EMVDictionary
type HMACOperation ¶
HMACOperation calculates a HMAC
func (HMACOperation) Calculate ¶
func (op HMACOperation) Calculate() (string, error)
Calculate uses the HMACOperation variables to calculate a HMAC
type HashOperation ¶
HashOperation to be populated by the caller
func (HashOperation) Calculate ¶
func (op HashOperation) Calculate() (string, error)
Calculate generates the hash of SHAOperation input string
type LuhnOperation ¶
LuhnOperation struct to be populated by the caller
func (LuhnOperation) Calculate ¶
func (op LuhnOperation) Calculate() (string, error)
Calculate performs an operation as described in the LuhnOperation variable, which should be populated by the caller
type PINBlockOperation ¶
type PINBlockOperation struct { PAN string PIN string PPK string PBF PINBlockFormat }
PINBlockOperation used to calculate clear and encrypted PIN blocks
func (PINBlockOperation) Calculate ¶
func (op PINBlockOperation) Calculate() (string, error)
Calculate returns a PINBlockResult containing the clear and encrypted PIN blocks
type PINBlockResult ¶
PINBlockResult contains the clear and encrypted PIN blocks
type PINOffsetOperation ¶
PINOffsetOperation struct to be populated be the caller
func (PINOffsetOperation) Calculate ¶
func (op PINOffsetOperation) Calculate() (string, error)
Calculate generates a natural PIN and PIN offset from data populated in a PINOffsetOperation variable
type PINOffsetResult ¶
PINOffsetResult contains the natural PIN and PIN offset
type PVVOperation ¶
PVVOperation struct to be populated by the caller
func (PVVOperation) Calculate ¶
func (op PVVOperation) Calculate() (string, error)
Calculate generates a PVV using input data populated in the PVVOperation variable
type RSAOperation ¶
type RSAOperation struct { Input string PublicExponent string PrivateExponent string Modulus string Label string HashMode HashMode Direction Direction }
RSAOperation to be instantiated and populated by the caller
func (RSAOperation) Calculate ¶
func (op RSAOperation) Calculate() (string, error)
Calculate the result of an RSA operation, as described by an instance of RSAOperation
type RetailMACOperation ¶
type RetailMACOperation struct { Key string Data string Padding RetailMACPaddingMode }
RetailMACOperation struct to be populated by the caller
func (RetailMACOperation) Calculate ¶
func (op RetailMACOperation) Calculate() (string, error)
Calculate results in the creation of a Retail MAC
type RetailMACPaddingMode ¶
type RetailMACPaddingMode string
RetailMACPaddingMode specifies the type of padding applied to the data
type SafeNetVariantOperation ¶
SafeNetVariantOperation instance to be instantiated and populated by the caller
func (SafeNetVariantOperation) Calculate ¶
func (op SafeNetVariantOperation) Calculate() (string, error)
Calculate uses a Master Key variant to result in a clear key from an encrypted key or an encrypted key from a clear key
type XOROperation ¶
XOROperation struct to be populated and provided by the caller
func (XOROperation) Calculate ¶
func (op XOROperation) Calculate() (string, error)
Calculate that from tiny acorns do mighty oaks grow