From dc2444a321a4fefb4a552f215409e404b3d03f7a Mon Sep 17 00:00:00 2001 From: horvski Date: Thu, 30 Nov 2023 12:54:22 -0700 Subject: [PATCH] Added Dave's suggestions in docs and updated built docs --- docs-src/content/functions/crypto.yml | 11 ++-- docs/content/functions/crypto.md | 94 +++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 6 deletions(-) diff --git a/docs-src/content/functions/crypto.yml b/docs-src/content/functions/crypto.yml index 2f263ab0b..33ba6976d 100644 --- a/docs-src/content/functions/crypto.yml +++ b/docs-src/content/functions/crypto.yml @@ -160,11 +160,10 @@ funcs: -----END PUBLIC KEY----- - name: crypto.Ed25519GenerateKey experimental: true - released: v4.0.0 + # released: v4.0.0 description: | Generate a new Ed25519 Private Key and output in PEM-encoded PKCS#8 ASN.1 DER form. - pipeline: true examples: - | $ gomplate -i '{{ crypto.Ed25519GenerateKey }}' @@ -172,7 +171,7 @@ funcs: ... - name: crypto.Ed25519GenerateKeyFromSeed experimental: true - released: v4.0.0 + # 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. @@ -182,16 +181,16 @@ funcs: required: true description: the encoding that the seed is in (`hex` or `base64`) - name: seed - reqruired: true + required: true description: the random seed encoded in either base64 or hex examples: - | - $ gomplate -i '{{ crypto.Ed25519GenerateKeyFromSeed base64 MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA= }}' + $ gomplate -i '{{ crypto.Ed25519GenerateKeyFromSeed "base64" MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA= }}' -----BEGIN PRIVATE KEY----- ... - name: crypto.Ed25519DerivePublicKey experimental: true - released: v4.0.0 + # released: v4.0.0 description: | Derive a public key from an Ed25519 private key and output in PKIX ASN.1 DER form. diff --git a/docs/content/functions/crypto.md b/docs/content/functions/crypto.md index 1720d5055..1a446c056 100644 --- a/docs/content/functions/crypto.md +++ b/docs/content/functions/crypto.md @@ -245,6 +245,100 @@ aztsmrD79OXXnhUlURI= -----END PUBLIC KEY----- ``` +## `crypto.Ed25519GenerateKey`_(unreleased)_ _(experimental)_ +**Unreleased:** _This function is in development, and not yet available in released builds of gomplate._ +**Experimental:** This function is [_experimental_][experimental] and may be enabled with the [`--experimental`][experimental] flag. + +[experimental]: ../config/#experimental + +Generate a new Ed25519 Private Key and output in +PEM-encoded PKCS#8 ASN.1 DER form. + +### Usage + +``` +crypto.Ed25519GenerateKey +``` + + +### Examples + +```console +$ gomplate -i '{{ crypto.Ed25519GenerateKey }}' +-----BEGIN PRIVATE KEY----- +... +``` + +## `crypto.Ed25519GenerateKeyFromSeed`_(unreleased)_ _(experimental)_ +**Unreleased:** _This function is in development, and not yet available in released builds of gomplate._ +**Experimental:** This function is [_experimental_][experimental] and may be enabled with the [`--experimental`][experimental] flag. + +[experimental]: ../config/#experimental + +Generate a new Ed25519 Private Key from a random seed and output in +PEM-encoded PKCS#8 ASN.1 DER form. + +### Usage + +``` +crypto.Ed25519GenerateKeyFromSeed encoding seed +``` +``` +seed | crypto.Ed25519GenerateKeyFromSeed encoding +``` + +### Arguments + +| name | description | +|------|-------------| +| `encoding` | _(required)_ the encoding that the seed is in (`hex` or `base64`) | +| `seed` | _(required)_ the random seed encoded in either base64 or hex | + +### Examples + +```console +$ gomplate -i '{{ crypto.Ed25519GenerateKeyFromSeed "base64" MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA= }}' +-----BEGIN PRIVATE KEY----- +... +``` + +## `crypto.Ed25519DerivePublicKey`_(unreleased)_ _(experimental)_ +**Unreleased:** _This function is in development, and not yet available in released builds of gomplate._ +**Experimental:** This function is [_experimental_][experimental] and may be enabled with the [`--experimental`][experimental] flag. + +[experimental]: ../config/#experimental + +Derive a public key from an Ed25519 private key and output in PKIX +ASN.1 DER form. + +### Usage + +``` +crypto.Ed25519DerivePublicKey key +``` +``` +key | crypto.Ed25519DerivePublicKey +``` + +### Arguments + +| name | description | +|------|-------------| +| `key` | _(required)_ the private key to derive a public key from | + +### Examples + +```console +$ gomplate -i '{{ crypto.Ed25519GenerateKey | crypto.Ed25519DerivePublicKey }}' +-----BEGIN PUBLIC KEY----- +... +``` +```console +$ gomplate -d key=priv.pem -i '{{ crypto.Ed25519DerivePublicKey (include "key") }}' +-----BEGIN PUBLIC KEY----- +...PK +``` + ## `crypto.PBKDF2` Run the Password-Based Key Derivation Function #2 as defined in