diff --git a/cmd/keycard/main.go b/cmd/keycard/main.go index 9bbb6e0..90d524a 100644 --- a/cmd/keycard/main.go +++ b/cmd/keycard/main.go @@ -205,7 +205,7 @@ func commandInfo(card *scard.Card) error { fmt.Printf("Installed: %+v\n", info.Installed) fmt.Printf("Initialized: %+v\n", info.Initialized) fmt.Printf("InstanceUID: 0x%x\n", info.InstanceUID) - fmt.Printf("PublicKey: 0x%x\n", info.PublicKey) + fmt.Printf("SecureChannelPublicKey: 0x%x\n", info.SecureChannelPublicKey) fmt.Printf("Version: 0x%x\n", info.Version) fmt.Printf("AvailableSlots: 0x%x\n", info.AvailableSlots) fmt.Printf("KeyUID: 0x%x\n", info.KeyUID) diff --git a/command_set.go b/command_set.go index 6432ab9..a243618 100644 --- a/command_set.go +++ b/command_set.go @@ -62,7 +62,7 @@ func (cs *CommandSet) Select() error { cs.ApplicationInfo = appInfo if cs.ApplicationInfo.HasSecureChannelCapability() { - err = cs.sc.GenerateSecret(cs.ApplicationInfo.PublicKey) + err = cs.sc.GenerateSecret(cs.ApplicationInfo.SecureChannelPublicKey) if err != nil { return err } diff --git a/types/application_info.go b/types/application_info.go index 6e7d645..c5c0563 100644 --- a/types/application_info.go +++ b/types/application_info.go @@ -30,12 +30,12 @@ const ( ) type ApplicationInfo struct { - Installed bool - Initialized bool - InstanceUID []byte - PublicKey []byte - Version []byte - AvailableSlots []byte + 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 @@ -68,10 +68,10 @@ func ParseApplicationInfo(data []byte) (*ApplicationInfo, error) { } if data[0] == TagSelectResponsePreInitialized { - info.PublicKey = data[2:] + info.SecureChannelPublicKey = data[2:] info.Capabilities = CapabilityCredentialsManagement - if len(info.PublicKey) > 0 { + if len(info.SecureChannelPublicKey) > 0 { info.Capabilities = info.Capabilities | CapabilitySecureChannel } @@ -116,7 +116,7 @@ func ParseApplicationInfo(data []byte) (*ApplicationInfo, error) { } info.InstanceUID = instanceUID - info.PublicKey = pubKey + info.SecureChannelPublicKey = pubKey info.Version = appVersion info.AvailableSlots = availableSlots info.KeyUID = keyUID