sshkey

package
v0.2.2-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sshkey is the ssh key conch reaches machines with, and the step that lets a sandbox in with it. It is shared by conch and conch-sandbox, so both offer the same key and find the one the other made.

Index

Constants

This section is empty.

Variables

View Source
var DefaultNames = []string{"id_ed25519", "id_ecdsa", "id_rsa"}

DefaultNames are the keys ssh would try by itself, in its own order.

Functions

func Authorize

func Authorize(ctx context.Context, p sandbox.Provider, id string, made func()) (string, error)

Authorize readies sandbox id for a login with this computer's key and returns the private key ssh has to offer, or "" when the provider hands out a secret instead. A provider that takes a key through its API is given it; one that lets in the keys registered with the person's account is offered the same key, which its Note says to register. made, when set, hears that conch's key was just created.

func AuthorizesKey

func AuthorizesKey(p sandbox.Provider) bool

AuthorizesKey says whether a provider that can take a key wants one: a provider described by a file says so in it.

func ConchKey

func ConchKey() string

ConchKey is the private key conch creates for machines when the user has none of their own.

func Keygen

func Keygen() string

Keygen is ssh-keygen; $CONCH_SSH_KEYGEN overrides it.

func Use

func Use(made func())

Use makes the key the one a provider file's create body is given as {public_key}, so the key later offered is the key that was put there. made, when set, hears that conch's key was just created.

func ValidLine

func ValidLine(s string) bool

ValidLine reports whether s looks like an OpenSSH public key line.

Types

type Key

type Key struct {
	Line string // the public key, one line
	Path string // its .pub file; the private half is beside it
	Made bool   // conch's key was created just now
}

Key is a public key to authorize on machines.

func Public

func Public(ctx context.Context) (Key, error)

Public returns a public key to authorize on machines: the user's own default key, else conch's, which is created when missing.

func (Key) Identity

func (k Key) Identity() string

Identity is the private key to offer for this public key.

Jump to

Keyboard shortcuts

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