sshkey

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: AGPL-3.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	KeyPath  string
	KeyOwner string
}

func Init

func Init(c config.PMMConfig) Handler

func (*Handler) Read

func (c *Handler) Read() (*Key, string, error)

Read reads ssh key from c.KeyPath and parses it, returns sshKey, result and error. sshKey is struct with parsed key. result is human readable message, which can be shown to the end user (can be localized). error is debug information which is passed for debug needs, shouldn't be shown to user.

func (*Handler) RunSSHKeyChecks

func (c *Handler) RunSSHKeyChecks()

func (*Handler) Write

func (c *Handler) Write(body io.ReadCloser) (*Key, string, error)

Write parses ssh key from json and writes to c.KeyPath and returns sshKey, result and error. sshKey is struct with parsed key. result is human readable message, which can be shown to the end user (can be localized). error is debug information which is passed for debug needs, shouldn't be shown to user.

type Key

type Key struct {
	Key         string `json:"key,omitempty"`
	Type        string `json:"type,omitempty"`
	Comment     string `json:"comment,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty"`
}

Jump to

Keyboard shortcuts

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