ssh

package
v0.0.0-...-5d16556 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadKeysInDir

func ReadKeysInDir(dir string) map[string]Key

ReadKeysInDir lists ssh public keys in a dir

Types

type Key

type Key struct {
	Type    string
	Keysize int
	Comment string
	Keydata []byte
}

Key represents an SSH public key

func ParseKey

func ParseKey(data []byte) (Key, error)

ParseKey parses the public key data. The fingerprint is calculated via SHA256

func (Key) Fingerprint

func (key Key) Fingerprint() (string, error)

Fingerprint returns the SHA256 hash of the fingerprint base64 standard encoded without a "SHA256:" prefix to be compatible with gin-auth

func (Key) MarshalAuthorizedKey

func (key Key) MarshalAuthorizedKey() []byte

MarshalAuthorizedKey creates a string representation that can be used in an authorized_keys file.

Jump to

Keyboard shortcuts

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