flux: github.com/weaveworks/flux/pkg/ssh Index | Files

package ssh

import "github.com/weaveworks/flux/pkg/ssh"

Index

Package Files

keygen.go keyring.go

type Fingerprint Uses

type Fingerprint struct {
    Hash      string `json:"hash"`
    Randomart string `json:"randomart"`
}

func ExtractFingerprint Uses

func ExtractFingerprint(privateKeyPath, hashAlgo string) (Fingerprint, error)

Fingerprint extracts and returns the hash and randomart of the public key associated with the specified private key.

type KeyBitsValue Uses

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

KeyBitsValue is an OptionalValue allowing specification of the -b argument to ssh-keygen.

func (*KeyBitsValue) Set Uses

func (kbv *KeyBitsValue) Set(s string) error

func (*KeyBitsValue) Specified Uses

func (kbv *KeyBitsValue) Specified() bool

func (*KeyBitsValue) String Uses

func (kbv *KeyBitsValue) String() string

func (*KeyBitsValue) Type Uses

func (kbv *KeyBitsValue) Type() string

type KeyFormatValue Uses

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

KeyFormatValue is an OptionalValue allowing specification of the -m argument to ssh-keygen.

func (*KeyFormatValue) Set Uses

func (ktv *KeyFormatValue) Set(s string) error

func (*KeyFormatValue) Specified Uses

func (ktv *KeyFormatValue) Specified() bool

func (*KeyFormatValue) String Uses

func (ktv *KeyFormatValue) String() string

func (*KeyFormatValue) Type Uses

func (ktv *KeyFormatValue) Type() string

type KeyRing Uses

type KeyRing interface {
    KeyPair() (publicKey PublicKey, privateKeyPath string)
    Regenerate() error
}

KeyRing is an abstraction providing access to a managed SSH key pair. Whilst the public half is available in byte form, the private half is left on the filesystem to avoid memory management issues.

func NewNopSSHKeyRing Uses

func NewNopSSHKeyRing() KeyRing

NewNopSSHKeyRing returns a KeyRing that doesn't do anything. It is meant for local development purposes when running fluxd outside a Kubernetes container.

type KeyTypeValue Uses

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

KeyTypeValue is an OptionalValue allowing specification of the -t argument to ssh-keygen.

func (*KeyTypeValue) Set Uses

func (ktv *KeyTypeValue) Set(s string) error

func (*KeyTypeValue) Specified Uses

func (ktv *KeyTypeValue) Specified() bool

func (*KeyTypeValue) String Uses

func (ktv *KeyTypeValue) String() string

func (*KeyTypeValue) Type Uses

func (ktv *KeyTypeValue) Type() string

type OptionalValue Uses

type OptionalValue interface {
    pflag.Value
    Specified() bool
}

OptionalValue is an extension of pflag.Value that remembers if it has been set.

type PublicKey Uses

type PublicKey struct {
    Key          string                 `json:"key"`
    Fingerprints map[string]Fingerprint `json:"fingerprints"`
}

func ExtractPublicKey Uses

func ExtractPublicKey(privateKeyPath string) (PublicKey, error)

ExtractPublicKey extracts and returns the public key from the specified private key, along with its fingerprint hashes.

func KeyGen Uses

func KeyGen(keyBits, keyType, keyFormat OptionalValue, tmpfsPath string) (privateKeyPath string, privateKey []byte, publicKey PublicKey, err error)

KeyGen generates a new keypair with ssh-keygen, optionally overriding the default type and size. Each generated keypair is written to a new unique subdirectory of tmpfsPath, which should point to a tmpfs mount as the private key is not encrypted.

Package ssh imports 9 packages (graph). Updated 2020-04-26. Refresh now. Tools for package owners.