sshagentkms

package
v0.15.12-rc5 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWrappedSignerFromSSHSigner

func NewWrappedSignerFromSSHSigner(signer ssh.Signer) crypto.Signer

NewWrappedSignerFromSSHSigner returns a new crypto signer wrapping the given one.

Types

type SSHAgentKMS

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

SSHAgentKMS is a key manager that uses keys provided by ssh-agent

func New

func New(ctx context.Context, opts apiv1.Options) (*SSHAgentKMS, error)

New returns a new SSHAgentKMS.

func NewFromAgent

func NewFromAgent(ctx context.Context, opts apiv1.Options, agentClient agent.Agent) (*SSHAgentKMS, error)

NewFromAgent initializes an SSHAgentKMS from a given agent, this method is used for testing purposes.

func (*SSHAgentKMS) Close

func (k *SSHAgentKMS) Close() error

Close closes the agent. This is a noop for the SSHAgentKMS.

func (*SSHAgentKMS) CreateKey

CreateKey generates a new key and returns both public and private key.

func (*SSHAgentKMS) CreateSigner

func (k *SSHAgentKMS) CreateSigner(req *apiv1.CreateSignerRequest) (crypto.Signer, error)

CreateSigner returns a new signer configured with the given signing key.

func (*SSHAgentKMS) GetPublicKey

func (k *SSHAgentKMS) GetPublicKey(req *apiv1.GetPublicKeyRequest) (crypto.PublicKey, error)

GetPublicKey returns the public key from the file passed in the request name.

type WrappedSSHSigner

type WrappedSSHSigner struct {
	Sshsigner ssh.Signer
}

WrappedSSHSigner is a utility type to wrap a ssh.Signer as a crypto.Signer

func (*WrappedSSHSigner) Public

func (s *WrappedSSHSigner) Public() crypto.PublicKey

Public returns the agent public key. The type of this public key is *agent.Key.

func (*WrappedSSHSigner) Sign

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

Sign signs the given digest using the ssh agent and returns the signature.

Jump to

Keyboard shortcuts

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