keycard-go/globalplatform/scp02_keys.go

26 lines
517 B
Go
Raw Normal View History

2018-09-27 13:29:07 +00:00
package globalplatform
2019-03-06 09:41:22 +00:00
// SCP02Keys is a struct that contains encoding and MAC keys used to communicate with smartcards.
type SCP02Keys struct {
2018-09-27 13:29:07 +00:00
enc []byte
mac []byte
}
2018-10-05 14:40:32 +00:00
// Enc returns the enc key data.
2019-03-06 09:41:22 +00:00
func (k *SCP02Keys) Enc() []byte {
2018-09-27 13:29:07 +00:00
return k.enc
}
2018-10-05 14:40:32 +00:00
// Mac returns the MAC key data.
2019-03-06 09:41:22 +00:00
func (k *SCP02Keys) Mac() []byte {
2018-09-27 13:29:07 +00:00
return k.mac
}
2019-03-06 09:41:22 +00:00
// NewSCP02Keys returns a new SCP02Keys with the specified ENC and MAC keys.
func NewSCP02Keys(enc, mac []byte) *SCP02Keys {
return &SCP02Keys{
2018-09-27 13:29:07 +00:00
enc: enc,
mac: mac,
}
}