Documentation ¶
Index ¶
- func ApduActivateOfflineKey(keyNo, keyVer int, divInput []byte) []byte
- func ApduChangeKeyEntryFullMode(keyNbr, proMax, cmdCtr int, keyVA, keyVB, keyVC []byte, ...) ([]byte, error)
- func ApduChangeKeyEntryMacMode(keyNbr, proMax, cmdCtr int, keyVA, keyVB, keyVC []byte, ...) ([]byte, error)
- func ApduChangeKeyEntryOffline(keyNbr, proMax, changeCtr int, keyVA, keyVB, keyVC []byte, ...) ([]byte, error)
- func ApduChangeKeyEntryPlainMode(keyNbr, proMax int, keyVA, keyVB, keyVC []byte, ...) ([]byte, error)
- func ApduDecipherOffline_Data(last bool, cipher []byte) []byte
- func ApduDecipher_Data(last bool, mifare int, cipher []byte) []byte
- func ApduDumpSecretKey(keyNo, keyVer int, divInput []byte) []byte
- func ApduDumpSessionKey() []byte
- func ApduEncipherOffline_Data(last bool, dataPlain []byte) []byte
- func ApduEncipher_Data(last bool, offset int, dataPlain []byte) []byte
- func ApduGenerateCmac_Data(last bool, dataPlain []byte) []byte
- func ApduGetVersion() []byte
- func ApduLockUnlock(keyNr, keyVr, unlockKeyNo, unlockKeyVer, p1 int, maxchainBlocks []byte) []byte
- func ApduLockUnlockPart2(cmacb, rnd []byte) []byte
- func ApduNonXauthMFPf1(first bool, sl, keyNo, keyVer int, data, dataDiv []byte) []byte
- func ApduNonXauthMFPf2(data []byte) []byte
- func ApduPKIExportPublicKey(pkiKeyNo int) []byte
- func ApduPKIGenerateKeyPair(pkiE []byte, pkiSET []byte, ...) [][]byte
- func ApduPKIImportKey(pkiKeyNo, pkiKeyNoCEK, pkiKeyVCEK, pkiRefNoKUC int, ...) [][]byte
- func ApduPKIUpdateKeyEntries(hashing HashingAlgorithm, keyEntrysNo int, pkiKeyNoEnc, pkiKeyNoSign int, ...) [][]byte
- func ApduSAMCombinedReadMFP(typeMFPdata TypeMFPdata, isLastFrame bool, data []byte) []byte
- func ApduSAMCombinedWriteMFP(typeMFPdata TypeMFPdata, data []byte) []byte
- func ApduSamKillAuthPICC() []byte
- func ExtSETConfigurationSettings(keyClass KeyClass, allowDumpSecretKey bool, restrictToDiversifiedUse bool) byte
- func SETConfigurationSettings(allowDumpSessionKey bool, keepIV bool, keyType KeyType, authKey bool, ...) []byte
- func SETConfigurationSettingsPKI(privKeyInclude bool, allowPrivKeyExport bool, disableKeyEntry bool, ...) []byte
- type CrytoAlgorithm
- type EntryKey
- type EntryKeyData
- type HashingAlgorithm
- type KeyClass
- type KeyType
- type PKIPubKey
- type ProMasEntryKey
- func (p ProMasEntryKey) UpdateAll() ProMasEntryKey
- func (p ProMasEntryKey) UpdateDFAidDFKey() ProMasEntryKey
- func (p ProMasEntryKey) UpdateKeyNoCEJKeyVCEK() ProMasEntryKey
- func (p ProMasEntryKey) UpdateKeyVa() ProMasEntryKey
- func (p ProMasEntryKey) UpdateKeyVb() ProMasEntryKey
- func (p ProMasEntryKey) UpdateKeyVc() ProMasEntryKey
- func (p ProMasEntryKey) UpdateKeyVerSentSep() ProMasEntryKey
- func (p ProMasEntryKey) UpdateRefKUC() ProMasEntryKey
- func (p ProMasEntryKey) UpdateSET() ProMasEntryKey
- type SamAv2
- type TypeMFPdata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApduActivateOfflineKey ¶
ApduActivateOfflineKey create apdu for SAM_ActiveOfflineKey command
func ApduChangeKeyEntryFullMode ¶
func ApduChangeKeyEntryFullMode(keyNbr, proMax, cmdCtr int, keyVA, keyVB, keyVC []byte, dfKeyNr, ceKNo, ceKV, kuc, verA, verB, verC, extSet byte, dfAid, set, kex, ke, km []byte, ) ([]byte, error)
ApduChangeKeyEntryFullMode create APDU to SAM_ApduChangeKeyEntry
func ApduChangeKeyEntryMacMode ¶
func ApduChangeKeyEntryMacMode(keyNbr, proMax, cmdCtr int, keyVA, keyVB, keyVC []byte, dfKeyNr, ceKNo, ceKV, kuc, verA, verB, verC, extSet byte, dfAid, set, km []byte, ) ([]byte, error)
ApduChangeKeyEntryMacMode create APDU to SAM_ApduChangeKeyEntry
func ApduChangeKeyEntryOffline ¶
func ApduChangeKeyEntryOffline(keyNbr, proMax, changeCtr int, keyVA, keyVB, keyVC []byte, dfKeyNr, ceKNo, ceKV, kuc, verA, verB, verC, extSet byte, dfAid, set []byte, kc, samUID []byte, ) ([]byte, error)
ApduChangeKeyEntryOffline create APDU to SAM_ApduChangeKeyEntry
func ApduChangeKeyEntryPlainMode ¶
func ApduChangeKeyEntryPlainMode(keyNbr, proMax int, keyVA, keyVB, keyVC []byte, dfKeyNr, ceKNo, ceKV, kuc, verA, verB, verC, extSet byte, dfAid, set []byte, ) ([]byte, error)
ApduChangeKeyEntryPlainMode create APDU to SAM_ApduChangeKeyEntry
func ApduDecipherOffline_Data ¶
ApduDecipherOffline_Data
func ApduDecipher_Data ¶
ApduDecipher_Data
func ApduDumpSecretKey ¶
ApduDumpSecretKey SAM_DumpSecretKey (allows dumping any of PICC keys or OfflineCrypto keys)
func ApduDumpSessionKey ¶
func ApduDumpSessionKey() []byte
ApduDumpSessionKey SAM_DumpSessionKey (session key of an established authentication with a DESFire or MIFARE Plus PICC)
func ApduEncipherOffline_Data ¶
ApduEncipherOffline_Data SAM_EncipherOffile_Data command encrypts data received from any other system based on the given cipher text data andt the current valid cryptographic OfflineCrypto Key.
func ApduEncipher_Data ¶
ApduEncipher_Data SAM_EncipherOffile_Data command encrypts data received from any other system based on the given cipher text data andt the current valid cryptographic OfflineCrypto Key.
func ApduGenerateCmac_Data ¶
ApduGenerateCmac_Data SAM_EncipherOffile_Data command encrypts data received from any other system based on the given cipher text data andt the current valid cryptographic OfflineCrypto Key.
func ApduLockUnlock ¶
ApduLockUnlock Apdu LockUnlock
func ApduLockUnlockPart2 ¶
ApduLockUnlockPart2 APDU LockUnlock part2
func ApduNonXauthMFPf1 ¶
ApduNonXauthMFPf1 SAM_AuthenticationMFP (non-X-mode) first part
func ApduNonXauthMFPf2 ¶
ApduNonXauthMFPf2 SAM_AuthenticationMFP (non-X-mode) second part
func ApduPKIExportPublicKey ¶
func ApduPKIGenerateKeyPair ¶
func ApduPKIImportKey ¶
func ApduPKIUpdateKeyEntries ¶
func ApduPKIUpdateKeyEntries(hashing HashingAlgorithm, keyEntrysNo int, pkiKeyNoEnc, pkiKeyNoSign int, pkiEncKeyFrame, pkiSignature []byte) [][]byte
func ApduSAMCombinedReadMFP ¶
func ApduSAMCombinedReadMFP(typeMFPdata TypeMFPdata, isLastFrame bool, data []byte, ) []byte
func ApduSAMCombinedWriteMFP ¶
func ApduSAMCombinedWriteMFP(typeMFPdata TypeMFPdata, data []byte, ) []byte
func ApduSamKillAuthPICC ¶
func ApduSamKillAuthPICC() []byte
ApduSamKillAuthPICC SAM_KillAuthentication invalidates any kind authentication PICC
func ExtSETConfigurationSettings ¶
func ExtSETConfigurationSettings(keyClass KeyClass, allowDumpSecretKey bool, restrictToDiversifiedUse bool) byte
ExtSETConfigurationSettings keyClass: KeyClass Type, multiple types support (example: OfflineChange_KEY | PICC_KEY)
Types ¶
type EntryKey ¶
type EntryKey struct { KeyVA []byte KeyVB []byte KeyVC []byte Va byte Vb byte Vc byte DfAID []byte DfKeyNo byte KeyNoCEK byte KeyVCEK byte RefNoKUC byte Set []byte ExtSet byte }
func NewEntryKey ¶
type EntryKeyData ¶
type EntryKeyData struct { Va byte Vb byte Vc byte DfAID []byte DfKeyNo byte KeyNoCEK byte KeyVCEK byte RefNoKUC byte Set []byte }
func NewEntryKeyData ¶
func NewEntryKeyData(data []byte, alg KeyType) *EntryKeyData
type HashingAlgorithm ¶
type HashingAlgorithm int
const ( SHA1 HashingAlgorithm = iota SHA224 RFU SHA256 )
type PKIPubKey ¶
type PKIPubKey struct { PKISet []byte PKIKeyNoCEK int PKIKeyVCEK int PKIRefNoKUC int PKINLen int PKIeLen int PKIN *big.Int PKIe int }
type ProMasEntryKey ¶
type ProMasEntryKey byte
func (ProMasEntryKey) UpdateAll ¶
func (p ProMasEntryKey) UpdateAll() ProMasEntryKey
func (ProMasEntryKey) UpdateDFAidDFKey ¶
func (p ProMasEntryKey) UpdateDFAidDFKey() ProMasEntryKey
func (ProMasEntryKey) UpdateKeyNoCEJKeyVCEK ¶
func (p ProMasEntryKey) UpdateKeyNoCEJKeyVCEK() ProMasEntryKey
func (ProMasEntryKey) UpdateKeyVa ¶
func (p ProMasEntryKey) UpdateKeyVa() ProMasEntryKey
func (ProMasEntryKey) UpdateKeyVb ¶
func (p ProMasEntryKey) UpdateKeyVb() ProMasEntryKey
func (ProMasEntryKey) UpdateKeyVc ¶
func (p ProMasEntryKey) UpdateKeyVc() ProMasEntryKey
func (ProMasEntryKey) UpdateKeyVerSentSep ¶
func (p ProMasEntryKey) UpdateKeyVerSentSep() ProMasEntryKey
func (ProMasEntryKey) UpdateRefKUC ¶
func (p ProMasEntryKey) UpdateRefKUC() ProMasEntryKey
func (ProMasEntryKey) UpdateSET ¶
func (p ProMasEntryKey) UpdateSET() ProMasEntryKey
type SamAv2 ¶
type SamAv2 interface { smartcard.ICard GetVersion() ([]byte, error) /*AuthHostAV2 SAM_AuthenticationHost AV2 mode key, key to Authentication keyNo, key entry number in SAM key storage keyVr, key version used hostMode, hostMode (0: plain, 1: Mac, 2: Full)*/ AuthHostAV2(key []byte, keyNo, keyVr, hostMode int) ([]byte, error) NonXauthMFPf1(first bool, sl, keyNo, keyVer int, data, dataDiv []byte) ([]byte, error) NonXauthMFPf2(data []byte) ([]byte, error) DumpSessionKey() ([]byte, error) DumpSecretKey(keyNo, keyVer int, divInput []byte) ([]byte, error) LockUnlock(key, maxchainBlocks []byte, keyNr, keyVr, unlockKeyNo, unlockKeyVer, p1 int) ([]byte, error) SwitchToAV2(key []byte, keyNr, keyVr int) ([]byte, error) AuthHostAV1(block cipher.Block, keyNo, keyVer, authMode int) ([]byte, error) ChangeKeyEntryAv1(keyNbr, proMax int, keyVA, keyVB, keyVC []byte, dfKeyNr, ceKNo, ceKV, kuc, verA, verB, verC byte, dfAid, set []byte, ) ([]byte, error) ChangeKeyEntry(keyNbr, proMax int, keyVA, keyVB, keyVC []byte, dfKeyNr, ceKNo, ceKV, kuc, verA, verB, verC, extSet byte, dfAid, set []byte, ) ([]byte, error) ChangeKeyEntryOffline(keyNbr, proMax, changeCtr int, keyVA, keyVB, keyVC []byte, dfKeyNr, ceKNo, ceKV, kuc, verA, verB, verC, extSet byte, dfAid, set []byte, kc, samUID []byte, ) ([]byte, error) SAMGetKeyEntry(keyNo int) ([]byte, error) ActivateOfflineKey(keyNo, keyVer int, divInput []byte, ) ([]byte, error) SAMCombinedWriteMFP(typeMFPdata TypeMFPdata, data []byte, ) ([]byte, error) SAMCombinedReadMFP(typeMFPdata TypeMFPdata, isLastFrame bool, data []byte, ) ([]byte, error) SAMEncipherData(alg CrytoAlgorithm, data []byte) ([]byte, error) SAMGenerateMAC(alg CrytoAlgorithm, data []byte) ([]byte, error) SAMEncipherOfflineData(alg CrytoAlgorithm, data []byte) ([]byte, error) SAMDecipherData(alg CrytoAlgorithm, data []byte) ([]byte, error) SAMDecipherOfflineData(alg CrytoAlgorithm, data []byte) ([]byte, error) PKIGenerateKeyPair(pkiE []byte, pkiSET []byte, pkiKeyNo, pkiKeyNoCEK, pkikeVCEK, pkiRefNoKUC, pkiNLen int) ([]byte, error) PKIExportPublicKey(pkiKeyNo int) ([]byte, error) PKIUpdateKeyEntries(hashing HashingAlgorithm, keyEntrysNo int, pkiKeyNoEnc, pkiKeyNoSign int, pkiEncKeyFrame, pkiSignature []byte) ([]byte, error) SAMLoadInitVector(alg CrytoAlgorithm, data []byte) ([]byte, error) PKIImportKey(pkiKeyNo, pkiKeyNoCEK, pkiKeyVCEK, pkiRefNoKUC int, pkiSET, pkie, pkiN, pkip, pkiq, pkidP, pkidQ, pkiipq []byte) ([]byte, error) }
SamAv2 Interface
func ConnectSam ¶
ConnectSam Create SamAv2 interface
func ConnectSamAv2 ¶
ConnectSamAv2 Create SamAv2 interface
type TypeMFPdata ¶
type TypeMFPdata int
const ( MFP_Command TypeMFPdata = 0x00 MFP_Response TypeMFPdata = 0x01 MFP_CommandResponse TypeMFPdata = 0x02 )