27 #define SSH_SK_USER_PRESENCE_REQD 0x01
28 #define SSH_SK_USER_VERIFICATION_REQD 0x04
29 #define SSH_SK_RESIDENT_KEY 0x20
32 #define SSH_SK_ECDSA 0x00
33 #define SSH_SK_ED25519 0x01
36 #define SSH_SK_ERR_GENERAL -1
37 #define SSH_SK_ERR_UNSUPPORTED -2
38 #define SSH_SK_ERR_PIN_REQUIRED -3
39 #define SSH_SK_ERR_DEVICE_NOT_FOUND -4
41 struct sk_enroll_response {
43 size_t public_key_len;
45 size_t key_handle_len;
48 uint8_t *attestation_cert;
49 size_t attestation_cert_len;
54 struct sk_sign_response {
63 struct sk_resident_key {
67 struct sk_enroll_response key;
77 #define SSH_SK_VERSION_MAJOR 0x00070000
78 #define SSH_SK_VERSION_MAJOR_MASK 0xffff0000
81 uint32_t sk_api_version(
void);
84 int sk_enroll(uint32_t alg,
const uint8_t *challenge,
size_t challenge_len,
85 const char *application, uint8_t flags,
const char *pin,
86 struct sk_option **options,
struct sk_enroll_response **enroll_response);
89 int sk_sign(uint32_t alg,
const uint8_t *data,
size_t data_len,
90 const char *application,
const uint8_t *key_handle,
size_t key_handle_len,
91 uint8_t flags,
const char *pin,
struct sk_option **options,
92 struct sk_sign_response **sign_response);
95 int sk_load_resident_keys(
const char *pin,
struct sk_option **options,
96 struct sk_resident_key ***rks,
size_t *nrks);