GET PUBLIC KEY Command

Fetch a public key from device.

Description

Fetch the public key of an Asymmetric Key.

Shell Example

Fetch the public key of Asymmetric Key 0x2846:

yubihsm> get pubkey 0 0x2846
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE85fayPHTvCrv0RRcyCsHv0hTKAM7
xHiU2I3NgO61RTRQumGDeBnQZIITykK/0PWKLGDANfBVrmKkWWxB47ze9A==
-----END PUBLIC KEY-----

Protocol Details

Command

Tc = 0x54
Lc = 2
Vc = I

Parameters:

I := Object ID of the Asymmetric Key (2 bytes)

Response

Tr = 0xd4
Lr = 1 + LP1 { + LP2 }
Vr = A || P1 { || P2 }

Parameters:

A := Algorithm (1 byte)

P1 :=

For RSA: Public modulus N (256, 384 or 512 bytes)

For ECC: Public point X (32, 48, 64 or 66 bytes)

For EDC: Public point A, compressed (32 bytes)

P2 :=

For RSA: NOT DEFINED

For ECC: Public point Y (32, 48, 64 or 66 bytes)

For EDC: NOT DEFINED