crypto

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CredentialsToMethods

func CredentialsToMethods(credentials []SSHCredentials, logger *zap.SugaredLogger) (methods []ssh.AuthMethod)

func DecryptPrivateKey

func DecryptPrivateKey(privkey, pass *memguard.LockedBuffer) (*memguard.LockedBuffer, error)

DecryptPrivateKey returns the decrypted version of the given private key, using a passphrase.

func GetAgentAuth

func GetAgentAuth() (ssh.AuthMethod, error)

func InputPassword

func InputPassword(prompt string) (*memguard.LockedBuffer, error)

func NeedPassphrase

func NeedPassphrase(privkey *memguard.LockedBuffer) (bool, error)

NeedPassphrase checks if the given private key needs a passphrase to be decoded.

func ReadCertificateFromFileSystem

func ReadCertificateFromFileSystem(path string) (*memguard.LockedBuffer, error)

func ReadPrivateKeyFromFileSystem

func ReadPrivateKeyFromFileSystem(path string) (*memguard.LockedBuffer, error)

func SerializePublicKey

func SerializePublicKey(public *PublicKey) (*memguard.LockedBuffer, error)

func Sign

func Sign(ctx context.Context, pub *PublicKey, login, sshMount, sshRole string, clt *api.Client, l *zap.SugaredLogger) (*memguard.LockedBuffer, error)

Types

type PublicKey

type PublicKey memguard.LockedBuffer

func DerivePublicKey

func DerivePublicKey(privkey *memguard.LockedBuffer) (*PublicKey, error)

func (*PublicKey) MarshalJSON

func (k *PublicKey) MarshalJSON() ([]byte, error)

type SSHCredentials

type SSHCredentials struct {
	PrivateKey  *memguard.LockedBuffer
	PublicKey   *PublicKey
	Certificate *memguard.LockedBuffer
	Password    *memguard.LockedBuffer
	Agent       bool
}

func GetSSHCredentials

func GetSSHCredentials(ctx context.Context, clictx params.CLIContext, loginName string, useAgent bool, l *zap.SugaredLogger) (*api.Client, []SSHCredentials, error)

func (SSHCredentials) AuthMethod

func (c SSHCredentials) AuthMethod() (ssh.AuthMethod, error)

Jump to

Keyboard shortcuts

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