EDDSA_PK_NEW(3)
π EDDSA_PK_NEW π (that's the eddsa_pk_new(3) page, bestie β Library Functions Manual, we're in section 3)
okay so picture this: you're deep in FIDO2 land and you need to move EDDSA public keys between libfido2 and OpenSSL. That's literally what this whole API is for. It's the FIDO2 COSE EDDSA API and it's giving β¨glue codeβ¨ but make it iconic. Let's get into it π«Ά
β¨ NAME β¨
eddsa_pk_new, eddsa_pk_free, eddsa_pk_from_EVP_PKEY, eddsa_pk_from_ptr, eddsa_pk_to_EVP_PKEY β FIDO2 COSE EDDSA API π
β¨ SYNOPSIS β¨
#include <openssl/evp.h>
#include <fido/eddsa.h>
eddsa_pk_t *
eddsa_pk_new(void);
void
eddsa_pk_free(eddsa_pk_t **pkp);
int
eddsa_pk_from_EVP_PKEY(eddsa_pk_t *pk, const EVP_PKEY *pkey);
int
eddsa_pk_from_ptr(eddsa_pk_t *pk, const void *ptr, size_t len);
EVP_PKEY *
eddsa_pk_to_EVP_PKEY(const eddsa_pk_t *pk);
πΈ DESCRIPTION πΈ
so EDDSA is the name that the CBOR Object Signing and Encryption (COSE) RFC gave to EDDSA over Curve25519 with SHA-512. That's the whole vibe. π
The COSE EDDSA API of libfido2 is an auxiliary API β like, it's not out here doing main character stuff, it's the supportive bestie with routines to convert between the different EDDSA public key types used in libfido2 and OpenSSL. Very "I got you" energy. π«Ά
In libfido2, EDDSA public keys are abstracted by the eddsa_pk_t type. That's the little container everything revolves around, no cap.
eddsa_pk_new()β returns a pointer to a newly allocated, emptyeddsa_pk_ttype. If memory cannot be allocated,NULLis returned. π (classic malloc betrayal)eddsa_pk_free()β releases the memory backing*pkp, where*pkpmust have been previously allocated byeddsa_pk_new(). On return,*pkpis set toNULL. Eitherpkpor*pkpmay beNULL, in which caseeddsa_pk_free()is a NOP. so chill of it honestly πeddsa_pk_from_EVP_PKEY()β fillspkwith the contents ofpkey. No references topkeyare kept. it copies and dips, no strings attached β¨eddsa_pk_from_ptr()β fillspkwith the contents ofptr, whereptrpoints tolenbytes. No references toptrare kept. same energy, different source π¦eddsa_pk_to_EVP_PKEY()β convertspkto a newly allocatedEVP_PKEYtype with a reference count of1. No internal references to the returned pointer are kept. If an error occurs,eddsa_pk_to_EVP_PKEY()returnsNULL. π₯
tiny note bestie: that reference count of1on the returnedEVP_PKEY? That's yours to manage. The library is not holding your hand on that one, and it keeps no internal references to that pointer. Periodt. π
π RETURN VALUES π
eddsa_pk_from_EVP_PKEY()andeddsa_pk_from_ptr()returnFIDO_OKon success. slay. β- On error, a different error code defined in
<fido/err.h>is returned. go read that header, iykyk π
π SEE ALSO π
the whole friend group fr fr π
okay that's the page!! This one came from the Debian folks, dated July 15, 2022, and it lives at EDDSA_PK_NEW(3) in the manual. go forth and convert your keys bestie, you're gonna ate π
β¨π
π¦ where this page comes from
- alpine 3.22: libfido2-doc 1.16.0-r0 Β· BSD-2-Clause
- alpine 3.23: libfido2-doc 1.16.0-r2 Β· BSD-2-Clause
- alpine 3.24: libfido2-doc 1.16.0-r4 Β· BSD-2-Clause
- arch rolling: libfido2 1.17.0-1 Β· BSD-2-Clause
- centos-stream 10: libfido2-devel 1.14.0-7.el10 Β· BSD-2-Clause
- centos-stream 9: libfido2-devel 1.13.0-2.el9 Β· BSD
- centos-stream 9: libfido2-devel 1.13.0-2.el9 Β· BSD
- debian bookworm: libfido2-doc 1.12.0-2 Β· BSD-2-Clause
- debian trixie: libfido2-doc 1.15.0-1 Β· BSD-2-Clause
- fedora 43: libfido2-devel 1.16.0-3.fc43 Β· BSD-2-Clause
- fedora 43: libfido2-devel 1.16.0-3.fc43 Β· BSD-2-Clause
- fedora 44: libfido2-devel 1.16.0-5.fc44 Β· BSD-2-Clause
- fedora 44: libfido2-devel 1.16.0-5.fc44 Β· BSD-2-Clause
- nixos 26.05: fido2-manage 0-unstable-2025-06-06
- nixpkgs unstable: fido2-manage 0-unstable-2025-06-06
- nixpkgs unstable: libfido2 1.17.0
- opensuse-leap 16.0: libfido2-devel 1.15.0-160000.3.2 Β· BSD-2-Clause
- opensuse-leap 16.0: libfido2-devel 1.15.0-160000.3.2 Β· BSD-2-Clause
- opensuse-leap 16.0: libfido2-devel 1.15.0-160000.3.2 Β· BSD-2-Clause
- opensuse-leap 16.0: libfido2-devel 1.15.0-160000.3.2 Β· BSD-2-Clause
- ubuntu noble: libfido2-doc 1.14.0-1build3 Β· BSD-2-Clause
- ubuntu questing: libfido2-doc 1.16.0-2
- ubuntu resolute: libfido2-doc 1.16.0-2build1 Β· BSD-2-Clause
- ubuntu stonking: libfido2-doc 1.17.0-2build1 Β· BSD-2-Clause
- π the page's license: BSD-2-Clause
- Copyright (c) 2019-2022 Yubico AB. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms