verify

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMatchingPrincipals

func GetMatchingPrincipals(as []AllowedSigner, signature *Signature) ([]string, error)

Finds matching principals for the given signature.

func VerifyFingerprints

func VerifyFingerprints(principal []byte, pubKey ssh.PublicKey) error

Compares the fingerprint of the principal with the public key in the signature.

Types

type AllowedSigner

type AllowedSigner struct {
	Email     string
	PublicKey string
}

func GetAllowedSigners

func GetAllowedSigners(f string) ([]AllowedSigner, error)

Parse a given file and returns a slice of AllowedSigners. This only supports one email address per public key, currently.

type Signature

type Signature struct {
	Signature     *ssh.Signature
	PublicKey     ssh.PublicKey
	HashAlgorithm string
}

func Decode

func Decode(b []byte) (*Signature, error)

Decodes a PEM encoded signature into a Signature struct. If invalid or unsupported data is found, an error is returned, even if the signature is valid for other use cases outside of the restrictions of this program.

func ParseSignatureFile

func ParseSignatureFile(filepath string) (*Signature, error)

Parse a given signature from a file and returns a Signature struct.

Jump to

Keyboard shortcuts

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