Documentation ¶
Index ¶
Constants ¶
View Source
const DriverGroup = "encryption"
Variables ¶
This section is empty.
Functions ¶
func GeneratePassword ¶
func GeneratePassword() string
func GetStaticSalt ¶
Types ¶
type CryptOptions ¶
type CryptOptions struct { StaticSaltIndex int `json:"StaticSaltIndex"` Cost int `json:"Cost"` Salt string `json:"Salt"` }
These are common parameters used by many drivers. Each driver may use structures that are specific to that driver.
func UnmarshalOptions ¶
func UnmarshalOptions(jsonOption string) (opt *CryptOptions, err error)
Unmarshal a json string containing the common options defined in CryptOptions and return the option structure
type EncryptDriver ¶
type EncryptDriver interface { EncryptPassword(password string, salt string) string ComparePasswords(string, string, string) bool Setup(string) EncryptDriver // The following are wrappers for the gdriver Id call. Id() string ShortHelp() string LongHelp() string }
The interface gives the set of methods that an encryption driver must implement.
func GetDefaultDriver ¶
func GetDefaultDriver() EncryptDriver
This will panic if no drivers have been registered
func GetDriver ¶
func GetDriver(name string) EncryptDriver
func SetDefault ¶
func SetDefault(name string) EncryptDriver
Pick a registered driver for use in the system. Only one driver can be selected at a time. This will panic if no drivers have been registered
Click to show internal directories.
Click to hide internal directories.