sshagent

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CryptoHashLookup = map[crypto.Hash]string{
	crypto.MD4:         "MD4",
	crypto.SHA1:        "SHA1",
	crypto.SHA224:      "SHA224",
	crypto.SHA256:      "SHA256",
	crypto.SHA384:      "SHA384",
	crypto.SHA512:      "SHA512",
	crypto.MD5SHA1:     "MD5SHA1",
	crypto.RIPEMD160:   "RIPEMD160",
	crypto.SHA3_224:    "SHA3_224",
	crypto.SHA3_256:    "SHA3_256",
	crypto.SHA3_384:    "SHA3_384",
	crypto.SHA3_512:    "SHA3_512",
	crypto.SHA512_224:  "SHA512_224",
	crypto.SHA512_256:  "SHA512_256",
	crypto.BLAKE2s_256: "BLAKE2s_256",
	crypto.BLAKE2b_256: "BLAKE2b_256",
	crypto.BLAKE2b_384: "BLAKE2b_384",
	crypto.BLAKE2b_512: "BLAKE2b_512",
}

CryptoHashLookup maps crypto.hash to string name

Functions

func NewKMSKeyring

func NewKMSKeyring(kmsKeyPath string) (sshAgent agent.ExtendedAgent, err error)

NewKMSKeyring returns an Agent that holds keys in memory. It is safe for concurrent use by multiple goroutines.

func NewKMSSigner

func NewKMSSigner(keyName string) (signer crypto.Signer, err error)

NewKMSSigner creates a new instance

func ParsePrivateSSHKey

func ParsePrivateSSHKey(privateKeyBytes []byte, passphrase string) (interface{}, error)

ParsePrivateSSHKey parses a private key

func StartSSHAgentServer

func StartSSHAgentServer(sshAgent agent.Agent) (sshAuthSock string, error error)

StartSSHAgentServer start an SSH Agent server and loads the given private key

Types

type KMSSigner

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

KMSSigner is a key

func (*KMSSigner) Digest

func (kmss *KMSSigner) Digest() crypto.Hash

Digest returns hash algo used for this key

func (*KMSSigner) Public

func (kmss *KMSSigner) Public() crypto.PublicKey

Public fetches public key

func (*KMSSigner) SSHPublicKey

func (kmss *KMSSigner) SSHPublicKey() ssh.PublicKey

SSHPublicKey fetches public key in ssh format

func (*KMSSigner) Sign

func (kmss *KMSSigner) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)

Sign with key

Jump to

Keyboard shortcuts

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