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 ¶
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.