Documentation ¶
Overview ¶
Package apdu is a generated GoMock package.
Index ¶
- Constants
- func IsTrailerError(err error, val TrailerError) bool
- type AFL
- type AFLEntry
- type AIP
- type ApplicationCryptogramType
- type ApplicationTemplate
- type CVMList
- type CVRule
- type Class
- type Client
- type Command
- type CryptogramInformationData
- type Driver
- type EMVProprietaryTemplate
- type FCITemplate
- type FileControlInformation
- type GenerateACResponse
- func (resp GenerateACResponse) ApplicationCryptogram() string
- func (resp GenerateACResponse) ApplicationTransactionCounter() string
- func (resp GenerateACResponse) CryptogramInformationData() CryptogramInformationData
- func (resp GenerateACResponse) Format() (int, error)
- func (resp GenerateACResponse) IssuerApplicationData() []byte
- type GenerateACResponseFormat1
- type GetProcessingOptionsResponse
- type GetProcessingOptionsResponseFormat2
- type HighLevelCommands
- type Instruction
- type LowLevelCommands
- type MockRawClient
- type MockRawClientMockRecorder
- type PSEFile
- type Parameters
- type ProprietaryFCITemplate
- type RawClient
- type RecordTemplate
- type Response
- type SecureMessagingIndication
- type Trailer
- type TrailerError
Constants ¶
View Source
const ( NoSMOrNoIndication = "No SM or no indication" ProprietarySMFormat = "Proprietary SM format" SMAccordingToSection6_NotProcessed = "SM according to section 6, command header not processed according to 6.2.3.1" SMAccordingToSection6_Authenticated = "SM according to section 6, command header authenticated according to 6.2.3.1" )
Variables ¶
This section is empty.
Functions ¶
func IsTrailerError ¶
func IsTrailerError(err error, val TrailerError) bool
Types ¶
type ApplicationCryptogramType ¶
type ApplicationCryptogramType byte
const ( AAC ApplicationCryptogramType = 0b00 TC ApplicationCryptogramType = 0b01 ARQC ApplicationCryptogramType = 0b10 )
type ApplicationTemplate ¶
type CVRule ¶
func (CVRule) ConditionString ¶
func (CVRule) Description ¶
func (CVRule) FailIfUncessful ¶
type Client ¶
type Client struct { RawClient LowLevelCommands LowLevelCommands HighLevelCommands }
type Command ¶
type Command struct { Class Class Instruction Instruction Parameters Parameters Data []byte MaxReponseLength byte }
func (Command) StringPretty ¶
type CryptogramInformationData ¶ added in v0.0.4
type CryptogramInformationData byte
func (CryptogramInformationData) AAC ¶ added in v0.0.4
func (cid CryptogramInformationData) AAC() bool
func (CryptogramInformationData) ARQC ¶ added in v0.0.4
func (cid CryptogramInformationData) ARQC() bool
func (CryptogramInformationData) RFU ¶ added in v0.0.4
func (cid CryptogramInformationData) RFU() bool
func (CryptogramInformationData) String ¶ added in v0.0.4
func (cid CryptogramInformationData) String() string
func (CryptogramInformationData) TC ¶ added in v0.0.4
func (cid CryptogramInformationData) TC() bool
type EMVProprietaryTemplate ¶
type EMVProprietaryTemplate struct { ApplicationTemplates []ApplicationTemplate `tlv:"61"` Track1DiscretionaryData string `tlv:"9f1f"` Track2EquivalentData []byte `tlv:"57"` CardholderName string `tlv:"5f20"` PAN string `tlv:"5a,hex"` PANSequenceNumber string `tlv:"5f34,hex"` ExpirationDate string `tlv:"5f24,hex"` UsageControl string `tlv:"9f07,hex"` IssuerCountryCode string `tlv:"5f28,hex"` EffectiveDate string `tlv:"5f25,hex"` ServiceCode string `tlv:"5f30,hex"` IssuerActionCodeDenial string `tlv:"9f0e,hex"` IssuerActionCodeOnline string `tlv:"9f0f,hex"` IssuerActionCodeDefault string `tlv:"9f0d,hex"` CAPublicKeyIndex1 string `tlv:"8f,hex"` IssuerPublicKeyExponent string `tlv:"9f32,hex"` IssuerPublicKeyCertificate string `tlv:"90,hex"` CurrencyCode string `tlv:"9f42,hex"` CurrencyExponent string `tlv:"9f44,hex"` CDOL1 tlv.TL `tlv:"8c"` CDOL1Hex string `tlv:"8c,hex"` CDOL2 tlv.TL `tlv:"8d,hex"` CDOL2Hex string `tlv:"8d,hex"` VersionNumber1 string `tlv:"9f08,hex"` ICCPublicKeyCertificate string `tlv:"9f46,hex"` ICCPublicKeyExponent string `tlv:"9f47,hex"` DDOL string `tlv:"9f49,hex"` CVMList CVMList `tlv:"8e"` CVMListBytes []byte `tlv:"8e"` UnknownTag9F69 []byte `tlv:"9f69"` RawTLV tlv.TLV `tlv:"raw"` }
func (EMVProprietaryTemplate) Merge ¶
func (et EMVProprietaryTemplate) Merge(other EMVProprietaryTemplate) EMVProprietaryTemplate
type FCITemplate ¶
type FCITemplate struct { DFName *string `tlv:"84,hex"` ProprietaryInformation *ProprietaryFCITemplate `tlv:"A5"` RawA5 string `tlv:"A5,hex"` }
type FileControlInformation ¶
type FileControlInformation struct { FCPTemplate []byte `tlv:"62"` FMDTemplate []byte `tlv:"64"` FCITemplate *FCITemplate `tlv:"6F"` Raw6F string `tlv:"6F,hex"` }
type GenerateACResponse ¶
type GenerateACResponse struct { Format1 GenerateACResponseFormat1 `tlv:"80"` Format2 struct { CryptogramInformationData CryptogramInformationData `tlv:"9f27"` ApplicationTransactionCounter string `tlv:"9f36,hex"` ApplicationCryptogram string `tlv:"9f26,hex"` IssuerApplicationData []byte `tlv:"9f10,hex"` SignedDynamicApplicationData string `tlv:"9f4b,hex"` Raw tlv.TLV `tlv:"raw"` } `tlv:"77"` Raw tlv.TLV `tlv:"raw"` }
func (GenerateACResponse) ApplicationCryptogram ¶ added in v0.0.4
func (resp GenerateACResponse) ApplicationCryptogram() string
func (GenerateACResponse) ApplicationTransactionCounter ¶ added in v0.0.4
func (resp GenerateACResponse) ApplicationTransactionCounter() string
func (GenerateACResponse) CryptogramInformationData ¶ added in v0.0.4
func (resp GenerateACResponse) CryptogramInformationData() CryptogramInformationData
func (GenerateACResponse) Format ¶ added in v0.0.5
func (resp GenerateACResponse) Format() (int, error)
func (GenerateACResponse) IssuerApplicationData ¶ added in v0.0.4
func (resp GenerateACResponse) IssuerApplicationData() []byte
type GenerateACResponseFormat1 ¶ added in v0.0.4
type GenerateACResponseFormat1 []byte
func (GenerateACResponseFormat1) ApplicationCryptogram ¶ added in v0.0.4
func (f1 GenerateACResponseFormat1) ApplicationCryptogram() string
func (GenerateACResponseFormat1) ApplicationTransactionCounter ¶ added in v0.0.4
func (f1 GenerateACResponseFormat1) ApplicationTransactionCounter() string
func (GenerateACResponseFormat1) CryptogramInformationData ¶ added in v0.0.4
func (f1 GenerateACResponseFormat1) CryptogramInformationData() CryptogramInformationData
func (GenerateACResponseFormat1) IssuerApplicationData ¶ added in v0.0.4
func (f1 GenerateACResponseFormat1) IssuerApplicationData() []byte
type GetProcessingOptionsResponse ¶ added in v0.0.3
type GetProcessingOptionsResponse struct { Format1 []byte `tlv:"80"` Format2 *GetProcessingOptionsResponseFormat2 `tlv:"77"` }
func (GetProcessingOptionsResponse) FileLocator ¶ added in v0.0.3
func (resp GetProcessingOptionsResponse) FileLocator() AFL
func (GetProcessingOptionsResponse) InterchangeProfile ¶ added in v0.0.3
func (resp GetProcessingOptionsResponse) InterchangeProfile() AIP
type GetProcessingOptionsResponseFormat2 ¶ added in v0.0.3
type HighLevelCommands ¶
type HighLevelCommands interface { SelectByName(dfname []byte) (FileControlInformation, error) ReadRecord(sfi, recordNumber int) (RecordTemplate, error) // ReadAllRecords tries to read the records of a file starting from record 1. When a // status 6A83 (Record Not Found) is returned, it considers that the sequence ended // and returns the previous records returned. ReadAllRecords(sfi int) ([]RecordTemplate, error) GetPSE(contactless bool) ([]RecordTemplate, error) GetProcessingOptions(pdolData []byte) (GetProcessingOptionsResponse, error) GenerateARQC(cdolData []byte) (GenerateACResponse, error) GenerateTC(transactionData []byte) (GenerateACResponse, error) }
type Instruction ¶
type Instruction byte
const ( Instruction44_ActivateFile Instruction = 0x44 InstructionE2_AppendRecord Instruction = 0xE2 Instruction24_ChangeReferenceData Instruction = 0x24 InstructionE0_CreateFile Instruction = 0xE0 Instruction04_DeactivateFile Instruction = 0x04 InstructionE4_DeleteFile Instruction = 0xE4 Instruction26_DisableVerificationRequirement Instruction = 0x26 Instruction28_EnableVerificationRequirement Instruction = 0x28 InstructionC2_Envelope Instruction = 0xC2 InstructionC3_Envelope Instruction = 0xC3 Instruction0E_EraseBinary Instruction = 0x0E Instruction0F_EraseBinary Instruction = 0x0F Instruction0C_EraseRecords Instruction = 0x0C Instruction82_ExternalMutualAuthenticate Instruction = 0x82 Instruction86_GeneralAuthenticate Instruction = 0x86 Instruction87_GeneralAuthenticate Instruction = 0x87 Instruction46_GenerateAsymmetricKeyPair Instruction = 0x46 Instruction84_GetChallenge Instruction = 0x84 InstructionCA_GetData Instruction = 0xCA InstructionCB_GetData Instruction = 0xCB InstructionC0_GetResponse Instruction = 0xC0 Instruction88_InternalAuthenticate Instruction = 0x88 Instruction70_ManageChannel Instruction = 0x70 Instruction22_ManageSecurityEnvironment Instruction = 0x22 Instruction10_PerformScqlOperation Instruction = 0x10 Instruction2A_PerformSecurityOperation Instruction = 0x2A Instruction12_PerformTransactionOperation Instruction = 0x12 Instruction14_PerformUserOperation Instruction = 0x14 InstructionDA_PutData Instruction = 0xDA InstructionDB_PutData Instruction = 0xDB InstructionB0_ReadBinary Instruction = 0xB0 InstructionB1_ReadBinary Instruction = 0xB1 InstructionB2_ReadRecords Instruction = 0xB2 InstructionB3_ReadRecords Instruction = 0xB3 Instruction2C_ResetRetryCounter Instruction = 0x2C InstructionA0_SearchBinary Instruction = 0xA0 InstructionA1_SearchBinary Instruction = 0xA1 InstructionA2_SearchRecord Instruction = 0xA2 InstructionA4_Select Instruction = 0xA4 InstructionFE_TerminateCardUsage Instruction = 0xFE InstructionE6_TerminateDf Instruction = 0xE6 InstructionE8_TerminateEf Instruction = 0xE8 InstructionD6_UpdateBinary Instruction = 0xD6 InstructionD7_UpdateBinary Instruction = 0xD7 InstructionDC_UpdateRecord Instruction = 0xDC InstructionDD_UpdateRecord Instruction = 0xDD Instruction20_Verify Instruction = 0x20 Instruction21_Verify Instruction = 0x21 InstructionD0_WriteBinary Instruction = 0xD0 InstructionD1_WriteBinary Instruction = 0xD1 InstructionD2_WriteRecord Instruction = 0xD2 )
Table 4.1 — Commands in the alphabetic order
const ( EMVInstructionA8_GetProcessingOptions Instruction = 0xA8 EMVInstructionAE_GenerateAC Instruction = 0xAE )
EMV instructions
type LowLevelCommands ¶
type LowLevelCommands interface { SelectByName(dfname []byte) ([]byte, error) ReadRecord(sfi, recordNumber int) ([]byte, error) GetProcessingOptions(pdolData []byte) ([]byte, error) GenerateAC(cryptogramType ApplicationCryptogramType, transactionData []byte) ([]byte, error) VerifyPlaintextPIN(pinDigits []int) ([]byte, error) }
type MockRawClient ¶ added in v0.0.3
type MockRawClient struct {
// contains filtered or unexported fields
}
MockRawClient is a mock of RawClient interface.
func NewMockRawClient ¶ added in v0.0.3
func NewMockRawClient(ctrl *gomock.Controller) *MockRawClient
NewMockRawClient creates a new mock instance.
func (*MockRawClient) EXPECT ¶ added in v0.0.3
func (m *MockRawClient) EXPECT() *MockRawClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRawClient) SendCommand ¶ added in v0.0.3
func (m *MockRawClient) SendCommand(cmd Command) (Response, error)
SendCommand mocks base method.
type MockRawClientMockRecorder ¶ added in v0.0.3
type MockRawClientMockRecorder struct {
// contains filtered or unexported fields
}
MockRawClientMockRecorder is the mock recorder for MockRawClient.
func (*MockRawClientMockRecorder) SendCommand ¶ added in v0.0.3
func (mr *MockRawClientMockRecorder) SendCommand(cmd any) *gomock.Call
SendCommand indicates an expected call of SendCommand.
type Parameters ¶
type ProprietaryFCITemplate ¶
type ProprietaryFCITemplate struct { ApplicationLabel *string `tlv:"50"` ApplicationPriorityIndicator *int `tlv:"87"` ShortFileIdentifier *int `tlv:"88"` LanguagePreference *string `tlv:"5f2d"` ApplicationPreferredNameEncoding *int `tlv:"9f11"` ApplicationPreferredName *string `tlv:"9f12"` PDOL tlv.TL `tlv:"9f38"` IssuerDiscretionaryData map[string][]byte `tlv:"bf0c"` }
type RawClient ¶
func NewRawClient ¶
type RecordTemplate ¶
type RecordTemplate struct {
EMVProprietaryTemplates []EMVProprietaryTemplate `tlv:"70"`
}
type SecureMessagingIndication ¶
type SecureMessagingIndication string
type TrailerError ¶
type TrailerError uint16
const ( ErrNoInformationGiven TrailerError = 0x6A00 ErrIncorrectParametersInTheCommandDataField TrailerError = 0x6A80 ErrFunctionNotSupported TrailerError = 0x6A81 ErrFileOrApplicationNotFound TrailerError = 0x6A82 ErrRecordNotFound TrailerError = 0x6A83 ErrNotEnoughMemorySpaceInTheFile TrailerError = 0x6A84 ErrNcInconsistentWithTLVStructure TrailerError = 0x6A85 ErrIncorrectParametersP1P2 TrailerError = 0x6A86 ErrNcInconsistentWithParametersP1P2 TrailerError = 0x6A87 ErrReferencedDataOrReferenceDataNotFound TrailerError = 0x6A88 ErrFileAlreadyExists TrailerError = 0x6A89 ErrDFNameAlreadyExists TrailerError = 0x6A8A )
func AsTrailerError ¶
func AsTrailerError(err error) (TrailerError, bool)
func (TrailerError) Error ¶
func (te TrailerError) Error() string
func (TrailerError) SW1 ¶
func (te TrailerError) SW1() byte
func (TrailerError) SW2 ¶
func (te TrailerError) SW2() byte
Source Files ¶
Click to show internal directories.
Click to hide internal directories.