From 914960f60a3c8ccb56d018b2d3fe8484ee9976d7 Mon Sep 17 00:00:00 2001 From: Jared Horvat Date: Sun, 17 Dec 2023 13:25:56 -0700 Subject: Add support for Ed25519 (#1900) * Add support for Ed25519 * Amended naming and added additional testing * Added changes from Dave's review * Next review: Fixed casing on error messages for linter | Fixed version number * Added Dave's suggestions in docs and updated built docs * Final push from Dave's review | Wrap crypto example in docs in quotes --- docs-src/content/functions/crypto.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'docs-src') diff --git a/docs-src/content/functions/crypto.yml b/docs-src/content/functions/crypto.yml index f7640baf..3e5754fb 100644 --- a/docs-src/content/functions/crypto.yml +++ b/docs-src/content/functions/crypto.yml @@ -158,6 +158,56 @@ funcs: +hIz6+EUt/Db51awO7iCuRly5L4TZ+CnMAsIbtUOqsqwSQDtv0AclAuogmCst75o aztsmrD79OXXnhUlURI= -----END PUBLIC KEY----- + - name: crypto.Ed25519GenerateKey + experimental: true + # released: v4.0.0 + description: | + Generate a new Ed25519 Private Key and output in + PEM-encoded PKCS#8 ASN.1 DER form. + examples: + - | + $ gomplate -i '{{ crypto.Ed25519GenerateKey }}' + -----BEGIN PRIVATE KEY----- + ... + - name: crypto.Ed25519GenerateKeyFromSeed + experimental: true + # released: v4.0.0 + description: | + Generate a new Ed25519 Private Key from a random seed and output in + PEM-encoded PKCS#8 ASN.1 DER form. + pipeline: true + arguments: + - name: encoding + required: true + description: the encoding that the seed is in (`hex` or `base64`) + - name: seed + required: true + description: the random seed encoded in either base64 or hex + examples: + - | + $ gomplate -i '{{ crypto.Ed25519GenerateKeyFromSeed "base64" "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=" }}' + -----BEGIN PRIVATE KEY----- + ... + - name: crypto.Ed25519DerivePublicKey + experimental: true + # released: v4.0.0 + description: | + Derive a public key from an Ed25519 private key and output in PKIX + ASN.1 DER form. + pipeline: true + arguments: + - name: key + required: true + description: the private key to derive a public key from + examples: + - | + $ gomplate -i '{{ crypto.Ed25519GenerateKey | crypto.Ed25519DerivePublicKey }}' + -----BEGIN PUBLIC KEY----- + ... + - | + $ gomplate -d key=priv.pem -i '{{ crypto.Ed25519DerivePublicKey (include "key") }}' + -----BEGIN PUBLIC KEY----- + ...PK - name: crypto.PBKDF2 released: v2.3.0 description: | -- cgit v1.2.3