sign

package
v0.0.0-...-3ed2260 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaServer

type CaServer struct {
	// Starter is a function to invoke for the beginning time of certificate
	// validity
	Starter func() time.Time
	// Random is an io.Reader used for signing ssh certificates
	Random io.Reader
	// contains filtered or unexported fields
}

CaServer stores a SSH Certificate Authority keypair for signing SSH keys

func NewCaServer

func NewCaServer() (*CaServer, error)

NewCaServer returns a server that can be used for signing keys. It is initialized with a new 4096 bit key

func ReadPrivKey

func ReadPrivKey(filename string) (*CaServer, error)

ReadPrivKey accepts an RSA private key and return a new *CaServer

func (*CaServer) Cert

func (c *CaServer) Cert() ssh.PublicKey

Cert returns the CA's Certificate

func (*CaServer) Sign

func (c *CaServer) Sign(userKey []byte, identity string, principals []string, validity time.Duration) ([]byte, error)

Sign signs a given SSH public key and returns the signed certificate

type Signer

type Signer interface {
	Sign(userKey []byte, identity string, principals []string, validity time.Duration) ([]byte, error)
	Cert() ssh.PublicKey
}

Signer is an interface for signing SSH keys

Jump to

Keyboard shortcuts

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