package
0.0.0-20220914100106-2be5f8e32ceb
Repository: https://github.com/wangyysde/sshclient.git
Documentation: pkg.go.dev
# README
sshkey: a small package for loading OpenSSH ECDSA and RSA keys.
The key may be loaded via file, HTTP(S), or as byte slices.
Example:
pub, keytype, err := sshkey.LoadPublicKeyFile("/home/user/.ssh/id_rsa.pub", false)
switch keytype {
case KEY_RSA: doSomethingRSA(pub.(*rsa.PublicKey))
case KEY_ECDSA: doSomethingEC(pub.(*ecdsa.PublicKey))
default: // unknown key type
}
priv, keytype, err := sshkey.LoadPrivateKeyFile("/home/user/.ssh/id_rsa")
switch keytype {
case KEY_RSA: doSomethingSecretRSA(pub.(*rsa.PrivateKey))
case KEY_ECDSA: doSomethingSecretEC(pub.(*ecdsa.PrivateKey))
default: // unknown key type
}
# Packages
Package readpass provides password reading functionality.
# Functions
DefaultPasswordPrompt is a simple (but echoing) password entry function that takes a prompt and reads the password.
Return the fingerprint of the key in a raw format.
Return a string containing a printable form of the key's fingerprint.
Generates a compatible OpenSSH private key.
Load an OpenSSH private key from a file.
LoadPublicKey loads an OpenSSH public key from a file or via HTTP.
Given a private key and a (possibly empty) password, returns a byte slice containing a PEM-encoded private key in the appropriate OpenSSH format.
MarshalPublic returns a byte slice containing an OpenSSH public key built from the SSHPublicKey.
Given a private key and comment, NewPublic will return a new SSHPublicKey.
Load an OpenSSH private key from a byte slice.
UnmarshalPublic decodes a byte slice containing an OpenSSH public key into an public key.
# Constants
These constants are used as the key type in the SSHPublicKey.
These constants are used as the key type in the SSHPublicKey.
These constants are used as the key type in the SSHPublicKey.
These constants are used as the key type in the SSHPublicKey.
These constants are used as the key type in the SSHPublicKey.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The PasswordPrompt function is the function that is called to prompt the user for a password.
PRNG contains the random data source to be used in key generation.
# Structs
Representation of an SSH public key in the library.
# Type aliases
Representation of type of SSH Key.