ssh

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

package ssh provides convenience wrappers around the golang.org/x/crypto/ssh package for handling SSH key formatting and operations.

package ssh provides cryptographic helpers for SSH key operations. This file contains logic for generating new SSH key pairs.

Index

Constants

This section is empty.

Variables

View Source
var FingerprintSHA256 = ssh.FingerprintSHA256

FingerprintSHA256 returns the SHA256 fingerprint of the public key.

View Source
var MarshalAuthorizedKey = ssh.MarshalAuthorizedKey

MarshalAuthorizedKey serializes a public key to the authorized_keys wire format.

View Source
var NewPublicKey = ssh.NewPublicKey

NewPublicKey creates a new ssh.PublicKey from a crypto.PublicKey.

Functions

func GenerateAndMarshalEd25519Key added in v1.3.3

func GenerateAndMarshalEd25519Key(comment string, passphrase string) (publicKeyString string, privateKeyString string, err error)

GenerateAndMarshalEd25519Key creates a new ed25519 key pair and returns them as formatted strings: the public key in authorized_keys format and the private key in PEM format. If a non-empty passphrase is provided, the private key will be encrypted with it.

func MarshalEd25519PrivateKey

func MarshalEd25519PrivateKey(key ed25519.PrivateKey, comment string) (*pem.Block, error)

MarshalEd25519PrivateKey converts an ed25519 private key to PEM format. It wraps the functionality from golang.org/x/crypto/ssh to produce a PEM block in the modern OpenSSH private key format.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL