guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using G-Expressions for public keys (substitutes and possibly more)


From: Liliana Marie Prikler
Subject: Using G-Expressions for public keys (substitutes and possibly more)
Date: Sun, 17 Oct 2021 14:47:21 +0200
User-agent: Evolution 3.34.2

Hi Guix,

let's say I wanted to add my own substitute server to my config.scm. 
At the time of writing, I would have to add said server's public key to
the authorized-keys of my guix-configuration like so:
  (cons* (local-file "my-key.pub") %default-authorized-guix-keys)
or similarily with append.  This local-file incantation is however
pretty weak.  It changes based on the current working directory and
even if I were to use an absolute path, I'd have to copy both that file
and the config.scm to a new machine were I to use the same
configuration there as well.

However, it turns out that the format for said key files is some
actually pretty readable Lisp-esque stuff.  For instance, an ECC key
reads like
  (public-key (ecc (curve CURVE) (q #Q#)))
with spaces omitted for simplicity.
Were it not for the (q #Q#) bit, we could construct it using scheme-
file.  In fact, it is so simple that in my local config I now do
exactly that.

(define-record-type* <ecc-key> ...)
(define-gexp-compiler (ecc-key-compiler (ecc-key <ecc-key>) ...) ...)

(ecc-key
  (name "my-key.pub")
  (curve 'Ed25519)
  (q "ABCDE..."))

Could/should we support such formats out of the box?  WDYT?

Regards,
Liliana




reply via email to

[Prev in Thread] Current Thread [Next in Thread]