1EDDSA_PK_NEW(3) BSD Library Functions Manual EDDSA_PK_NEW(3)
2
4 eddsa_pk_new, eddsa_pk_free, eddsa_pk_from_EVP_PKEY, eddsa_pk_from_ptr,
5 eddsa_pk_to_EVP_PKEY — FIDO2 COSE EDDSA API
6
8 #include <openssl/evp.h>
9 #include <fido/eddsa.h>
10
11 eddsa_pk_t *
12 eddsa_pk_new(void);
13
14 void
15 eddsa_pk_free(eddsa_pk_t **pkp);
16
17 int
18 eddsa_pk_from_EVP_PKEY(eddsa_pk_t *pk, const EVP_PKEY *pkey);
19
20 int
21 eddsa_pk_from_ptr(eddsa_pk_t *pk, const void *ptr, size_t len);
22
23 EVP_PKEY *
24 eddsa_pk_to_EVP_PKEY(const eddsa_pk_t *pk);
25
27 EDDSA is the name given in the CBOR Object Signing and Encryption (COSE)
28 RFC to EDDSA over Curve25519 with SHA-512. The COSE EDDSA API of
29 libfido2 is an auxiliary API with routines to convert between the differ‐
30 ent EDDSA public key types used in libfido2 and OpenSSL.
31
32 In libfido2, EDDSA public keys are abstracted by the eddsa_pk_t type.
33
34 The eddsa_pk_new() function returns a pointer to a newly allocated, empty
35 eddsa_pk_t type. If memory cannot be allocated, NULL is returned.
36
37 The eddsa_pk_free() function releases the memory backing *pkp, where *pkp
38 must have been previously allocated by eddsa_pk_new(). On return, *pkp
39 is set to NULL. Either pkp or *pkp may be NULL, in which case
40 eddsa_pk_free() is a NOP.
41
42 The eddsa_pk_from_EVP_PKEY() function fills pk with the contents of pkey.
43 No references to pkey are kept.
44
45 The eddsa_pk_from_ptr() function fills pk with the contents of ptr, where
46 ptr points to len bytes. No references to ptr are kept.
47
48 The eddsa_pk_to_EVP_PKEY() function converts pk to a newly allocated
49 EVP_PKEY type with a reference count of 1. No internal references to the
50 returned pointer are kept. If an error occurs, eddsa_pk_to_EVP_PKEY()
51 returns NULL.
52
54 The eddsa_pk_from_EVP_PKEY() and eddsa_pk_from_ptr() functions return
55 FIDO_OK on success. On error, a different error code defined in
56 <fido/err.h> is returned.
57
59 es256_pk_new(3), es384_pk_new(3), fido_assert_verify(3),
60 fido_cred_pubkey_ptr(3), rs256_pk_new(3)
61
62BSD July 15, 2022 BSD