config

package
v0.0.0-...-4805961 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Keys             []Key
	Potps            []Potp
	PreferredKeyCN   string
	PreferredPotpCN  string
	PuzzleDifficulty int
	TripleAES256     TripleAES256Config
	// contains filtered or unexported fields
}

func LoadFrom

func LoadFrom(file string, password string) (cfg *Config, err error)

Empty password implies no encryption

func LoadFromInteractive

func LoadFromInteractive(file string) (cfg *Config, err error)

It will ask for a password, if required

func NewEmpty

func NewEmpty() *Config

func (*Config) ContainsKeyById

func (c *Config) ContainsKeyById(keyId string) bool

func (*Config) CreateAndAddInPlacePotp

func (c *Config) CreateAndAddInPlacePotp(size int, cn string) (*Potp, error)

func (*Config) CreateAndAddKey

func (c *Config) CreateAndAddKey(keyType cryptoutil.KeyType, cn string) (*Key, error)

func (*Config) DeleteKeyByUUID

func (c *Config) DeleteKeyByUUID(uuid string) bool

func (*Config) DeletePotpByUUID

func (c *Config) DeletePotpByUUID(uuid string) bool

func (*Config) GetKeyByCN

func (c *Config) GetKeyByCN(cn string) (*Key, error)

func (*Config) GetKeyByID

func (c *Config) GetKeyByID(keyId string) (*Key, error)

func (*Config) GetPotpByCN

func (c *Config) GetPotpByCN(cn string) (*Potp, error)

func (*Config) GetPotpByID

func (c *Config) GetPotpByID(potpId string) (*Potp, error)

func (*Config) HasDiskEncryptionPassword

func (c *Config) HasDiskEncryptionPassword() bool

func (*Config) NextSequentialKeyCN

func (c *Config) NextSequentialKeyCN() int64

func (*Config) NextSequentialPotpCN

func (c *Config) NextSequentialPotpCN() int64

func (*Config) SaveTo

func (c *Config) SaveTo(file string) (err error)

func (*Config) SetDiskEncryptionPassword

func (c *Config) SetDiskEncryptionPassword(password string)

type Key

type Key struct {
	Type string
	CN   string
	Uuid string
	Pvt  string
	Pub  string
}

func (*Key) GetKeyType

func (k *Key) GetKeyType() cryptoutil.KeyType

func (*Key) IdAs32Byte

func (k *Key) IdAs32Byte() [32]byte

func (*Key) PubBytes

func (k *Key) PubBytes() (pub []byte)

func (*Key) PvtBytes

func (k *Key) PvtBytes() (pvt []byte)

type Potp

type Potp struct {
	Uuid string
	CN   string
	Body string
}

func (*Potp) BodyBytes

func (p *Potp) BodyBytes() []byte

func (*Potp) GetSize

func (p *Potp) GetSize() uint64

func (*Potp) IdAs32Byte

func (p *Potp) IdAs32Byte() [32]byte

func (*Potp) PickOTP

func (p *Potp) PickOTP(size int) (otp []byte, offset uint64)

the following does not implements file based OTPs

func (*Potp) ReadOTP

func (p *Potp) ReadOTP(size int, offset uint64) ([]byte, error)

type TripleAES256Config

type TripleAES256Config string
const (
	TripleAES256Required TripleAES256Config = "required"
	TripleAES256Allowed  TripleAES256Config = "allowed"
	TripleAES256Disabled TripleAES256Config = "disabled"
)

Jump to

Keyboard shortcuts

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