lws

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ENVELOPE_FILEEXT = ".h132"

Variables

View Source
var (
	ErrNoKeys = errors.New("no keys in the letter writing set")
)

Functions

func CheckWriteAccess

func CheckWriteAccess(dir string) error

CheckWriteAccess checks if the user has write access to the specified directory.

func DumpStatus

func DumpStatus(lws *pb.LetterWritingSet) error

func Edit

func Edit(l *pb.LetterWritingSet, ak envelope.AssymmetricKey, envelopePath string, envelopeBs []byte, plaintextPath string) error

func GetEnvelopePath

func GetEnvelopePath(plaintextPath string) string

func GetKeyByName

func GetKeyByName(lws *pb.LetterWritingSet, name string) *pb.KeyImpl

func GetKeyByPublicKey

func GetKeyByPublicKey(lws *pb.LetterWritingSet, needle *ecdsa.PublicKey) *pb.KeyImpl

func GetLWSDir

func GetLWSDir() string

func GetLWSWireProtoPath

func GetLWSWireProtoPath() string

func GetPlaintextDir

func GetPlaintextDir() string

func GetPlaintextPath

func GetPlaintextPath(envelopePath string) string

func GetPublicKeys

func GetPublicKeys(l *pb.LetterWritingSet) []*ecdsa.PublicKey

func ReadLWS

func ReadLWS() (*pb.LetterWritingSet, error)

func RunEditor

func RunEditor(filepath string)

func RunPostEditHook

func RunPostEditHook(lws *pb.LetterWritingSet, envelopePath string) error

func RunPreEditHook

func RunPreEditHook(lws *pb.LetterWritingSet, envelopePath string) error

func Seal

func Seal(l *pb.LetterWritingSet, ak envelope.AssymmetricKey, fileName string, contents []byte) error

func SetProperty

func SetProperty(lws *pb.LetterWritingSet, propertyName, value string) error

func Unseal

func Unseal(ak envelope.AssymmetricKey, envelopeFilePath string, envelopeBs []byte) error

func UpdateLWS

func UpdateLWS(lws *pb.LetterWritingSet, flags UpdateFlags) error

func WriteLWS

func WriteLWS(lws *pb.LetterWritingSet, openflags int) error

Types

type UpdateFlags

type UpdateFlags int
const (
	UpdateRemoveKey UpdateFlags = 1 << iota
)

Jump to

Keyboard shortcuts

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