diff options
| author | Jared Horvat <horvski@gmail.com> | 2023-12-17 13:25:56 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-17 15:25:56 -0500 |
| commit | 914960f60a3c8ccb56d018b2d3fe8484ee9976d7 (patch) | |
| tree | 30369f20cb0206e2e31dd1618a230bd0cd39a614 /docs/content | |
| parent | 36fb3f05006bdab3f9b96400a9043cfe7430cc1d (diff) | |
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
Diffstat (limited to 'docs/content')
| -rw-r--r-- | docs/content/functions/crypto.md | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/docs/content/functions/crypto.md b/docs/content/functions/crypto.md index 1720d505..9f6393f1 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 |
