types

package
v0.0.0-...-8d18b63 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagSelectResponsePreInitialized uint8 = 0x80
	TagApplicationStatusTemplate    uint8 = 0xA3
	TagApplicationInfoTemplate      uint8 = 0xA4
	TagApplicationInfoCapabilities  uint8 = 0x8D
)

Variables

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
	SeedExportable         []byte
	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 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 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