rename public key to secure channel public key in app info
This commit is contained in:
parent
04dc8df36c
commit
3371792bf0
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue