cryptapi

package
v0.0.0-...-ece1c8e Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const Version = 1

Variables

This section is empty.

Functions

func BufferInFile

func BufferInFile(r io.Reader) (rc io.ReadSeekCloser, e error)

func SplitPath

func SplitPath(path string) (device, infix, hash string, e error)

Types

type Clerk

type Clerk struct {
	RemoteClerk demonapi.Clerk
	Config      ClerkConfig
}

func LoadConfig

func LoadConfig(configPath string) (*Clerk, error)

func NewClerk

func NewClerk(config ClerkConfig) (*Clerk, error)

func (*Clerk) DeviceName

func (c *Clerk) DeviceName() (string, error)

func (*Clerk) GetDecryptObject

func (c *Clerk) GetDecryptObject(path string) (b []byte, err error)

func (*Clerk) GetDecryptObjectStream

func (c *Clerk) GetDecryptObjectStream(path string) (rc io.ReadCloser, err error)

func (*Clerk) HMAC

func (c *Clerk) HMAC(key string) string

HMAC is used by git-annex remote to protect filename infixes.

func (*Clerk) ListObjects

func (c *Clerk) ListObjects() ([]string, error)

func (*Clerk) PutEncryptObject

func (c *Clerk) PutEncryptObject(pathInfix string, data []byte) (string, error)

func (*Clerk) PutEncryptObjectStream

func (c *Clerk) PutEncryptObjectStream(pathInfix string, data io.Reader) (createdFilename string, err error)

type ClerkConfig

type ClerkConfig struct {
	SecretKey   string               `json:"secret-key"`
	SpaceConfig demonapi.ClerkConfig `json:"space"`
	WorkFactor  int                  `json:"age-work-factor"`
}

type CombinedReadCloser

type CombinedReadCloser struct {
	io.Reader
	io.Closer
}

type StreamHeader

type StreamHeader struct {
	Version int    `json:"version"`
	Device  string `json:"device"`
	Infix   string `json:"infix"`
}

Jump to

Keyboard shortcuts

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