• 1.0.2 310b1d1eab

    feat(role): Add SSH key pair and derivatives generation function

    hygienic-books released this 2025-09-18 22:45:29 +00:00 | 0 commits to main since this release

    function ssh_keysuite_gen generates an OpenSSH-formatted SSH
    public-private key pair. This is the OpenSSH default key format, its
    plain text file header string reads:

    -----
    BEGIN OPENSSH PRIVATE KEY
    -----
    

    Depending on key type it then generates all possible additional
    formats for both public and private key. For all key types
    currently recommended by ssh-keygen (ed25519, rsa2, ecdsa) the
    function generates an RFC4716-formatted public key. This plain text
    file has header string:

    -----
    BEGIN SSH2 PUBLIC KEY
    -----
    

    Also for all key types currently recommended by ssh-keygen the
    function then converts the private key into PuTTYgen format.

    Afterwards rsa2 and ecdsa keys are further processed. These steps do
    not apply to ed25519 keys as no such processing is possible. For an
    rsa2 key the function converts its private key into a PEM-encoded
    PKCS#1 key with plain text file header string:

    -----
    BEGIN RSA PRIVATE KEY
    -----
    

    For an elliptic curve key (i.e. an ecdsa key) the function converts
    it into a PEM-encoded Elliptic Curve key with the following plain
    text file header string:

    -----
    BEGIN EC PRIVATE KEY
    -----
    

    For both rsa2 and ecdsa keys the function then converts the private
    key to PEM-encoded PKCS#8 format marked by either one of the
    following two plain text file header strings:

    -----
    BEGIN PRIVATE KEY
    -----
    

    or

    -----
    BEGIN ENCRYPTED PRIVATE KEY
    -----
    

    Also for both rsa2 and ecdsa key the function converts the public key
    into SubjectPublicKeyInfo (SPKI) format which looks like so:

    -----
    BEGIN PUBLIC KEY
    -----
    

    This function serves as a shortcut to cover all bases for systems and
    software that depend on SSH keys in specific formats.

    Downloads