Documentation ¶
Index ¶
- Variables
- func Decrypt(ciphertext []byte, key []byte) ([]byte, error)
- func Encrypt(plaintext []byte, key []byte) ([]byte, error)
- func GetKey(password string, salt []byte) ([]byte, error)
- type EncryptedDB
- func (db *EncryptedDB) Clear(bucket []byte) error
- func (db *EncryptedDB) Close() error
- func (db *EncryptedDB) Delete(bucket []byte, key []byte) error
- func (db *EncryptedDB) DoesKeyExist(bucket, key []byte) (bool, error)
- func (db *EncryptedDB) Get(bucket []byte, key []byte, destination interfaces.BinaryMarshallable) (interfaces.BinaryMarshallable, error)
- func (db *EncryptedDB) GetAll(bucket []byte, sample interfaces.BinaryMarshallableAndCopyable) ([]interfaces.BinaryMarshallableAndCopyable, [][]byte, error)
- func (db *EncryptedDB) Init(filename string, dbtype string)
- func (db *EncryptedDB) ListAllBuckets() ([][]byte, error)
- func (db *EncryptedDB) ListAllKeys(bucket []byte) (keys [][]byte, err error)
- func (db *EncryptedDB) Lock()
- func (db *EncryptedDB) Put(bucket []byte, key []byte, data interfaces.BinaryMarshallable) error
- func (db *EncryptedDB) PutInBatch(records []interfaces.Record) error
- func (db *EncryptedDB) Trim()
- func (db *EncryptedDB) UnlockFor(password string, duration time.Duration) error
- type EncryptedMarshaler
- func (e *EncryptedMarshaler) MarshalBinary() (rval []byte, err error)
- func (e *EncryptedMarshaler) New() interfaces.BinaryMarshallableAndCopyable
- func (e *EncryptedMarshaler) UnmarshalBinary(cipherData []byte) (err error)
- func (e *EncryptedMarshaler) UnmarshalBinaryData(cipherData []byte) (newData []byte, err error)
- type SecureDBMetaData
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Bucket for all db metadata EncyptedMetaData = []byte("EncyptedDBMetaData") TimeCheck = time.Time{} // Used to Check if time has been initiated )
Functions ¶
Types ¶
type EncryptedDB ¶
type EncryptedDB struct { // Allow the wallet to be locked, by gating access based // on time. UnlockedUntil time.Time // contains filtered or unexported fields }
EncryptedDB is a database with symmetric encryption to encrypt all writes, and decrypt all reads
func NewEncryptedDB ¶
func NewEncryptedDB(filename, dbtype, password string) (*EncryptedDB, error)
NewEncryptedDB takes the filename, dbtype, and password.
Dbtype : Map Bolt LevelDB
func (*EncryptedDB) Clear ¶
func (db *EncryptedDB) Clear(bucket []byte) error
func (*EncryptedDB) Close ¶
func (db *EncryptedDB) Close() error
func (*EncryptedDB) Delete ¶
func (db *EncryptedDB) Delete(bucket []byte, key []byte) error
We don't care if delete works or not. If the key isn't there, that's ok
func (*EncryptedDB) DoesKeyExist ¶
func (db *EncryptedDB) DoesKeyExist(bucket, key []byte) (bool, error)
func (*EncryptedDB) Get ¶
func (db *EncryptedDB) Get(bucket []byte, key []byte, destination interfaces.BinaryMarshallable) (interfaces.BinaryMarshallable, error)
func (*EncryptedDB) GetAll ¶
func (db *EncryptedDB) GetAll(bucket []byte, sample interfaces.BinaryMarshallableAndCopyable) ([]interfaces.BinaryMarshallableAndCopyable, [][]byte, error)
func (*EncryptedDB) Init ¶
func (db *EncryptedDB) Init(filename string, dbtype string)
func (*EncryptedDB) ListAllBuckets ¶
func (db *EncryptedDB) ListAllBuckets() ([][]byte, error)
func (*EncryptedDB) ListAllKeys ¶
func (db *EncryptedDB) ListAllKeys(bucket []byte) (keys [][]byte, err error)
func (*EncryptedDB) Lock ¶
func (db *EncryptedDB) Lock()
Lock locks the database such that further access calls will fail until it is unlocked
func (*EncryptedDB) Put ¶
func (db *EncryptedDB) Put(bucket []byte, key []byte, data interfaces.BinaryMarshallable) error
func (*EncryptedDB) PutInBatch ¶
func (db *EncryptedDB) PutInBatch(records []interfaces.Record) error
type EncryptedMarshaler ¶
type EncryptedMarshaler struct { EncryptionKey []byte Original interfaces.BinaryMarshallable }
func NewEncryptedMarshaler ¶
func NewEncryptedMarshaler(key []byte, o interfaces.BinaryMarshallable) *EncryptedMarshaler
func (*EncryptedMarshaler) MarshalBinary ¶
func (e *EncryptedMarshaler) MarshalBinary() (rval []byte, err error)
func (*EncryptedMarshaler) New ¶
func (e *EncryptedMarshaler) New() interfaces.BinaryMarshallableAndCopyable
func (*EncryptedMarshaler) UnmarshalBinary ¶
func (e *EncryptedMarshaler) UnmarshalBinary(cipherData []byte) (err error)
func (*EncryptedMarshaler) UnmarshalBinaryData ¶
func (e *EncryptedMarshaler) UnmarshalBinaryData(cipherData []byte) (newData []byte, err error)
type SecureDBMetaData ¶
type SecureDBMetaData struct { Salt primitives.ByteSlice Challenge primitives.ByteSlice }
func NewSecureDBMetaData ¶
func NewSecureDBMetaData() *SecureDBMetaData
func (*SecureDBMetaData) IsSameAs ¶
func (m *SecureDBMetaData) IsSameAs(b *SecureDBMetaData) bool
func (*SecureDBMetaData) MarshalBinary ¶
func (m *SecureDBMetaData) MarshalBinary() (rval []byte, err error)
func (*SecureDBMetaData) UnmarshalBinary ¶
func (m *SecureDBMetaData) UnmarshalBinary(data []byte) (err error)
func (*SecureDBMetaData) UnmarshalBinaryData ¶
func (m *SecureDBMetaData) UnmarshalBinaryData(data []byte) (newData []byte, err error)
Click to show internal directories.
Click to hide internal directories.