publickey

package
v1.0.2-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisallowedTypes = []string{
	gossh.KeyAlgoDSA,
}

Functions

This section is empty.

Types

type KeyInfo

type KeyInfo struct {
	Key gossh.PublicKey
}

func From

func From(key gossh.PublicKey) KeyInfo

func Parse

func Parse(keyData []byte) (KeyInfo, string, error)

func ParseString

func ParseString(keyData string) (KeyInfo, string, error)

func (KeyInfo) Fingerprint

func (key KeyInfo) Fingerprint() string

func (KeyInfo) Matches

func (key KeyInfo) Matches(s string) bool

func (KeyInfo) MatchesKey

func (key KeyInfo) MatchesKey(otherKey gossh.PublicKey) bool

func (KeyInfo) Type

func (key KeyInfo) Type() string

type LocalService

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

func NewService

func NewService(
	publicKeyStore store.PublicKeyStore,
	pCache store.PrincipalInfoCache,
) LocalService

func (LocalService) ValidateKey

func (s LocalService) ValidateKey(
	ctx context.Context,
	publicKey ssh.PublicKey,
	usage enum.PublicKeyUsage,
) (*types.PrincipalInfo, error)

ValidateKey tries to match the provided key to one of the keys in the database. It updates the verified timestamp of the matched key to mark it as used.

type Service

type Service interface {
	ValidateKey(ctx context.Context, publicKey ssh.PublicKey, usage enum.PublicKeyUsage) (*types.PrincipalInfo, error)
}

func ProvidePublicKey

func ProvidePublicKey(
	publicKeyStore store.PublicKeyStore,
	pCache store.PrincipalInfoCache,
) Service

Jump to

Keyboard shortcuts

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