Documentation ¶
Overview ¶
Package gopace allows to establish a secure channel between card and host using PACE protocol.
Index ¶
- func CMAC(kmac []byte, data []byte) (mac []byte, err error)
- func ComputeAuthenticationToken(deroid, msx, msy []byte) []byte
- func DecryptNonce(can []byte, encNonce []byte) (decNonce []byte, err error)
- func GetAPDU(header, data []byte, le []byte) (apdu []byte)
- func GetNonce(card *PlainCard) (encNonce []byte, err error)
- func MapNonce(card *PlainCard, x, y []byte) (x2, y2 []byte, err error)
- func MappedBasePoint(decNonce []byte, sx, sy []byte) (mx, my []byte)
- func MappedECDH(sk2 []byte, msx, msy []byte) (smsx, smsy []byte)
- func MappedPublicKey(sk2 []byte, mx, my []byte) (msx, msy []byte)
- func MarshalECPoint(x, y []byte) []byte
- func MutualAuthentication(card Carder, tcmac, ccmac []byte) error
- func PerformKeyAgreement(card *PlainCard, msx, msy []byte) (msx2, msy2 []byte, err error)
- func ReadBinary(card Carder) (content []byte, err error)
- func SelectFile(card Carder, file []byte) (err error)
- func SessionKeys(smsx []byte) (kenc, kmac []byte)
- func SetAuthenticationTemplate(card *PlainCard, pi *PersonalInfo) (err error)
- func SharedPoint(x, y, sk []byte) (sx, sy []byte)
- func TerminalKeyMap(sk []byte) (x, y []byte, err error)
- func UnmarshalECPoint(m []byte) (x, y []byte)
- type Carder
- type PersonalInfo
- type PersonalInfoSET
- type PlainCard
- type SecureCard
- func (sc *SecureCard) DecData(edata []byte) (data []byte, err error)
- func (sc *SecureCard) EncData(data []byte) (enced []byte, err error)
- func (sc *SecureCard) PadData(data []byte) (padded []byte)
- func (sc *SecureCard) Prepare(header, data, le []byte) (apdu []byte, err error)
- func (sc *SecureCard) Process(encresp []byte) (data []byte, sw []byte, err error)
- func (sc *SecureCard) RemovePad(data []byte) (unpadded []byte)
- func (sc *SecureCard) SSC() []byte
- func (sc *SecureCard) Transmit(header, data, le []byte) (resp []byte, err error)
- func (sc *SecureCard) TransmitAPDU(apdu []byte) (resp []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MappedBasePoint ¶
func MappedECDH ¶
func MappedPublicKey ¶
func MarshalECPoint ¶
func MutualAuthentication ¶
func PerformKeyAgreement ¶
func ReadBinary ¶
ReadBinary reads the content of an already chosen file.
func SelectFile ¶
SelectFile selects a file given the file identifier and a Carder.
func SessionKeys ¶
func SetAuthenticationTemplate ¶
func SetAuthenticationTemplate(card *PlainCard, pi *PersonalInfo) (err error)
func SharedPoint ¶
func TerminalKeyMap ¶
func UnmarshalECPoint ¶
Types ¶
type Carder ¶
type Carder interface { Transmit(header []byte, data []byte, le []byte) (resp []byte, err error) TransmitAPDU(apdu []byte) (resp []byte, err error) }
Carder abstracts communication between host and card over insecure and secure channel
type PersonalInfo ¶
func ReadCardAccess ¶
func ReadCardAccess(card *PlainCard) (pi *PersonalInfo, err error)
type PersonalInfoSET ¶
type PersonalInfoSET []PersonalInfo
type PlainCard ¶
type PlainCard struct {
// contains filtered or unexported fields
}
type SecureCard ¶
type SecureCard struct {
// contains filtered or unexported fields
}
func (*SecureCard) PadData ¶
func (sc *SecureCard) PadData(data []byte) (padded []byte)
func (*SecureCard) Prepare ¶
func (sc *SecureCard) Prepare(header, data, le []byte) (apdu []byte, err error)
func (*SecureCard) Process ¶
func (sc *SecureCard) Process(encresp []byte) (data []byte, sw []byte, err error)
func (*SecureCard) RemovePad ¶
func (sc *SecureCard) RemovePad(data []byte) (unpadded []byte)
func (*SecureCard) SSC ¶
func (sc *SecureCard) SSC() []byte
func (*SecureCard) Transmit ¶
func (sc *SecureCard) Transmit(header, data, le []byte) (resp []byte, err error)
func (*SecureCard) TransmitAPDU ¶
func (sc *SecureCard) TransmitAPDU(apdu []byte) (resp []byte, err error)
Click to show internal directories.
Click to hide internal directories.