keycard-go/types/types.go

33 lines
709 B
Go
Raw Normal View History

2019-03-11 11:05:28 +01:00
package types
2018-10-24 18:16:14 +02:00
2019-03-11 11:49:00 +01:00
import "github.com/status-im/keycard-go/apdu"
// Channel is an interface with a Send method to send apdu commands and receive apdu responses.
type Channel interface {
Send(*apdu.Command) (*apdu.Response, error)
}
2018-10-24 18:16:14 +02:00
type ApplicationInfo struct {
2018-11-06 12:54:11 +01:00
Installed bool
Initialized bool
2018-10-24 18:16:14 +02:00
InstanceUID []byte
PublicKey []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
}
2018-11-07 14:39:58 +01:00
type ApplicationStatus struct {
PinRetryCount int
PUKRetryCount int
KeyInitialized bool
PubKeyDerivation bool
}
2018-10-24 18:16:14 +02:00
type PairingInfo struct {
2018-11-06 12:54:11 +01:00
Key []byte
Index int
2018-10-24 18:16:14 +02:00
}