Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveKey ¶
func DeriveKey(o []DeriveOptionsBuilder) ([]byte, error)
DeriveKey from the options provided.
Types ¶
type DeriveOptionsBuilder ¶
type DeriveOptionsBuilder func(*DeriveOpts)
DeriveOptionsBuilder creates the options to derive a key from scrypt.
func DefaultDeriveOptions ¶
func DefaultDeriveOptions() DeriveOptionsBuilder
DefaultDeriveOptions for deriving an encryption.
func FromEncryptedKey ¶
func FromEncryptedKey(length, n, p, r int, salt []byte) DeriveOptionsBuilder
FromEncryptedKey generate the options builder from an encrypted key.
func RandomSalt ¶
func RandomSalt() (DeriveOptionsBuilder, error)
RandomSalt use a secure random number to use as the salt.
func WithPassphrase ¶
func WithPassphrase(passphrase string) DeriveOptionsBuilder
WithPassphrase adds passphrase to the dervive options
type DeriveOpts ¶
type DeriveOpts struct { Len int `json:"len"` N int `json:"n"` P int `json:"p"` R int `json:"r"` Salt []byte `json:"salt"` Passphrase string `json:"-"` }
DeriveOpts available for scrypt key derivation.
func CreateOptions ¶
func CreateOptions(o []DeriveOptionsBuilder) *DeriveOpts
CreateOptions that can be stored.
Click to show internal directories.
Click to hide internal directories.