Categorygithub.com/ScaleFT/sshkeys
modulepackage
1.4.0
Repository: https://github.com/scaleft/sshkeys.git
Documentation: pkg.go.dev

# README

sshkeys

GoDoc Build Status

sshkeys provides utilities for parsing and marshalling cryptographic keys used for SSH, in both cleartext and encrypted formats.

ssh.ParseRawPrivateKey only supports parsing a subset of the formats sshkeys supports, does not support parsing encrypted private keys, and does not support marshalling.

Supported Formats

  • OpenSSH's PROTOCOL.key for RSA and ED25519 keys.
  • OpenSSH version >= 7.6 using aes256-ctr encryption
  • "Classic" PEM containing RSA (PKCS#1), DSA (OpenSSL), and ECDSA private keys.

# Functions

Marshal converts a private key into an optionally encrypted format.
ParseEncryptedPrivateKey returns a Signer from an encrypted private key.
ParseEncryptedRawPrivateKey returns a private key from an encrypted private key.

# Constants

FormatClassicPEM encodes private keys in PEM, with a key-specific encoding, as used by OpenSSH.
FormatOpenSSHv1 encodes a private key using OpenSSH's PROTOCOL.key format: https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key.

# Variables

ErrIncorrectPassword is returned when the supplied passphrase was not correct for an encrypted private key.

# Structs

MarshalOptions provides the Marshal function format and encryption options.

# Type aliases

Format of private key to use when Marshaling.