types

package
v0.0.0-...-1153de6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2023 License: MPL-2.0 Imports: 6 Imported by: 3

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

type Channel interface {
	Send(*apdu.Command) (*apdu.Response, error)
}

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 PairingInfo struct {
	Key   []byte
	Index int
}

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

func ParseSignature

func ParseSignature(message, resp []byte) (*Signature, error)

func (*Signature) PubKey

func (s *Signature) PubKey() []byte

func (*Signature) R

func (s *Signature) R() []byte

func (*Signature) S

func (s *Signature) S() []byte

func (*Signature) V

func (s *Signature) V() byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL