unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Using G-Expressions for public keys (substitutes and possibly more)
@ 2021-10-17 12:47 Liliana Marie Prikler
  2021-10-21 20:13 ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Liliana Marie Prikler @ 2021-10-17 12:47 UTC (permalink / raw)
  To: guix-devel

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-23 17:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-17 12:47 Using G-Expressions for public keys (substitutes and possibly more) Liliana Marie Prikler
2021-10-21 20:13 ` Ludovic Courtès
2021-10-22  4:47   ` Liliana Marie Prikler
2021-11-21  0:12     ` Jelle Licht
2021-11-21  8:28       ` Liliana Marie Prikler
2021-11-22 13:27         ` Ludovic Courtès
2021-11-22 14:32           ` Jelle Licht
2021-11-22 19:35           ` Liliana Marie Prikler
2021-11-23 17:14             ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).