factotum

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package factotum encapsulates crypto operations on user's public/private keys.

Index

Constants

This section is empty.

Variables

View Source
var AllUsersKeyHash = KeyHash(upspin.AllUsersKey)

AllUsersKeyHash is the hash of upspin.AllUsersKey.

Functions

func KeyHash

func KeyHash(p upspin.PublicKey) []byte

KeyHash returns the hash of a key, given in string format.

func NewFromDir

func NewFromDir(dir string) (upspin.Factotum, error)

NewFromDir returns a new Factotum providing all needed private key operations, loading keys from a directory containing *.upspinkey files. Our desired end state is that Factotum is implemented on each platform by the best local means of protecting private keys. Please do not break the abstraction by hand coding direct generation or use of private keys.

func NewFromKeys

func NewFromKeys(public, private, archived []byte) (upspin.Factotum, error)

NewFromKeys returns a new Factotum by providing it with the raw representation of an Upspin user's public, private and optionally, archived keys.

func ParsePublicKey

func ParsePublicKey(public upspin.PublicKey) (*ecdsa.PublicKey, error)

ParsePublicKey takes an Upspin representation of a public key and converts it into an ECDSA public key. The Upspin string representation uses \n as newline no matter what native OS it runs on.

func Verify

func Verify(hash []byte, sig upspin.Signature, key upspin.PublicKey) error

Verify verifies whether the given hash's signature was signed by the private key corresponding to the given public key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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