sshutil

package
v0.0.0-...-0ca31db Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2016 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package SSHUtil provides some additional utilites to the golang.org/x/crypto/ssh libraries. These including methods for validating and parsing public keys.

Index

Constants

This section is empty.

Variables

An array of algorithms accepted by the SSH protocol.

Functions

func GetAlgorithm

func GetAlgorithm(key []byte) (string, error)

Given a byte array of SSH Key bytes, GetAlgorithm will deduce the public key format identifier. This is always included with traditional SSH Key algorithms as RSA and DSA.

func GetFingerPrint

func GetFingerPrint(key OpenSSHPublicKey, algo string) (fp string, err error)

func ParseDecodedKey

func ParseDecodedKey(in []byte) (out, rest []byte, ok bool)

Given a byte array of SSH Key bytes, ParseDecodedKey returns the public key format identifier as well as the remainder of the key data and a read OK return. This is implemented internally in crypto/ssh as parseString, but is included here as a general utility parser. If only the algorithm is wanted, GetAlgorithm provides better functionality.

func ValidateOpenSSHPublicKey

func ValidateOpenSSHPublicKey(key OpenSSHPublicKey) error

Types

type OpenSSHPublicKey

type OpenSSHPublicKey struct {
	// contains filtered or unexported fields
}

SSH Public key struct as defined by the rfc4253 section 6.6

func ParseKeyfile

func ParseKeyfile(dotpub string) (key OpenSSHPublicKey, err error)

When given the contents of an public key file, this will return with a OpenSSHPublicKey struct that contains the contents of the keyfile. The comment section of the keyfile is ignored. The contents of the keyfile are not validated.

Jump to

Keyboard shortcuts

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