profile

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(key *memguard.LockedBuffer, in *InnerData, fname string) (err error)

Save takes InnerData, encrypts it with the provided key and saves under the selected filename.

Types

type InnerData

type InnerData struct {
	// Key is the master key used to encrypt files at rest
	Key *memguard.LockedBuffer

	// AWSKeyId ia the AWS Key ID used to upload/download files
	AWSKeyId *memguard.LockedBuffer

	// AWSSecret is the AWS Secret associated with the AWS Key ID
	AWSSecret *memguard.LockedBuffer

	// BucketName is the S3 bucket name
	BucketName string

	// Endpoint is the S3 endpoint to connect to
	Endpoint string

	// Region is the AWS region in which the S3 bucket is located
	Region string
}

InnerData is the actual profile data, stored in an encrypted format

func NewInner

func NewInner() (in *InnerData, err error)

NewInner creates a mew InnerData instance with a randomly generated master key.

func Open

func Open(fname string) (in *InnerData, err error)

Open reads the profile file from provided location and returns decrypted InnerData.

type OuterData

type OuterData struct {
	// Magic is a string indicator of this indeed being an ogive struct
	Magic string

	// Version ia the profile file version, in case the spec changes
	Version uint32

	// Salt is the salt value used for password derivation to unseal the InnerData
	Salt []byte

	// Inner is the encrypted, serialized representation of InnerData
	Inner []byte
}

OuterData is a wrapper for InnerData that holds information needed to perform encryption and decryption of the stored information

Jump to

Keyboard shortcuts

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