Documentation ¶
Index ¶
Constants ¶
View Source
const ( TagSelectResponsePreInitialized uint8 = 0x80 TagApplicationStatusTemplate uint8 = 0xA3 TagApplicationInfoTemplate uint8 = 0xA4 TagApplicationInfoCapabilities uint8 = 0x8D )
View Source
const ( LifeCycleOpReady lifeCycle = 0x01 LifeCycleInitialized = 0x07 LifeCycleSecured = 0x0F LifeCycleCardLocked = 0x7F LifeCycleTerminated = 0xFF )
Variables ¶
View Source
var ( TagGetStatusTemplate = apdu.Tag{0xE3} TagGetStatusLifeCycleState = apdu.Tag{0x9F, 0x70} )
View Source
var ErrApplicationStatusTemplateNotFound = errors.New("application status template not found")
View Source
var ErrWrongApplicationInfoTemplate = errors.New("wrong application info template")
View Source
var (
TagSignatureTemplate = uint8(0xA0)
)
Functions ¶
This section is empty.
Types ¶
type ApplicationInfo ¶
type ApplicationInfo struct { Installed bool Initialized bool InstanceUID []byte SecureChannelPublicKey []byte Version []byte AvailableSlots []byte // KeyUID is the sha256 of of the master public key on the card. // It's empty if the card doesn't contain any key. KeyUID []byte Capabilities Capability }
func ParseApplicationInfo ¶
func ParseApplicationInfo(data []byte) (*ApplicationInfo, error)
func (*ApplicationInfo) HasCapability ¶
func (a *ApplicationInfo) HasCapability(c Capability) bool
func (*ApplicationInfo) HasCredentialsManagementCapability ¶
func (a *ApplicationInfo) HasCredentialsManagementCapability() bool
func (*ApplicationInfo) HasKeyManagementCapability ¶
func (a *ApplicationInfo) HasKeyManagementCapability() bool
func (*ApplicationInfo) HasNDEFCapability ¶
func (a *ApplicationInfo) HasNDEFCapability() bool
func (*ApplicationInfo) HasSecureChannelCapability ¶
func (a *ApplicationInfo) HasSecureChannelCapability() bool
type ApplicationStatus ¶
type ApplicationStatus struct { PinRetryCount int PUKRetryCount int KeyInitialized bool Path string }
func ParseApplicationStatus ¶
func ParseApplicationStatus(data []byte) (*ApplicationStatus, error)
type Capability ¶
type Capability uint8
const ( CapabilitySecureChannel Capability = 1 << iota CapabilityKeyManagement CapabilityCredentialsManagement CapabilityNDEF CapabilityAll = CapabilitySecureChannel | CapabilityKeyManagement | CapabilityCredentialsManagement | CapabilityNDEF )
type CardStatus ¶
type CardStatus struct {
// contains filtered or unexported fields
}
func ParseCardStatus ¶
func ParseCardStatus(data []byte) (*CardStatus, error)
func (*CardStatus) LifeCycle ¶
func (cs *CardStatus) LifeCycle() string
type CashApplicationInfo ¶
type CashApplicationInfo struct { Installed bool PublicKey []byte PublicData []byte Version []byte }
func ParseCashApplicationInfo ¶
func ParseCashApplicationInfo(data []byte) (*CashApplicationInfo, error)
type Channel ¶
Channel is an interface with a Send method to send apdu commands and receive apdu responses.
type ErrInvalidLifeCycleValue ¶
type ErrInvalidLifeCycleValue struct {
// contains filtered or unexported fields
}
func (*ErrInvalidLifeCycleValue) Error ¶
func (e *ErrInvalidLifeCycleValue) Error() string
type PairingInfo ¶
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
func ParseSignature ¶
Click to show internal directories.
Click to hide internal directories.