ssh

package
v0.0.0-...-23a2324 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSFingerprint

type AWSFingerprint string

AWSFingerprint is a special Amazon EC2 MD5 fingerprint calculated from the PEM-encoded public key. It is used in AWS for ssh keys.

func GenerateAWSFingerprint

func GenerateAWSFingerprint(pubkeyBody []byte) (AWSFingerprint, error)

GenerateAWSFingerprint parses a public key and returns AWS PEM fingerprint used for RSA keys. MD5 fingerprint stored as hexadecimal with colons without any prefix from key in PEM format. This format is specific to AWS. To generate such fingerprint:

ssh-keygen -e -f $HOME/.ssh/key.pub -m pkcs8 | openssl pkey -pubin -outform der | openssl md5 -c

Example: "c4:ba:72:45:16:a9:2c:39:c3:99:8d:e7:16:01:9c:77"

type OpenSSHFingerprints

type OpenSSHFingerprints struct {
	Type    string
	SHA256  string
	MD5     string
	Comment string
}

OpenSSHFingerprints is the de-facto standard OpenSSH fingerprints for SSH public keys: SHA256 (used for ED type keys) and MD5 (used for RSA keys). Fingerprints are returned as string encoded into base64 or hex respectively. Additionally, type and comment are also returned. Type as one of the: "ssh-ed25519" or "ssh-rsa".

func GenerateOpenSSHFingerprints

func GenerateOpenSSHFingerprints(pubkeyBody []byte) (OpenSSHFingerprints, error)

GenerateOpenSSHFingerprints parses a public key and returns OpenSSH fingerprints.

Jump to

Keyboard shortcuts

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