Documentation ¶
Index ¶
- Constants
- func Register()
- func SetDefault()
- type PwdSha512
- func (t *PwdSha512) ComparePasswords(hashedPassword, clearPassword, salt string) bool
- func (t *PwdSha512) EncryptPassword(clearPassword, userSalt string) string
- func (t *PwdSha512) Id() string
- func (t *PwdSha512) LongHelp() string
- func (t *PwdSha512) Setup(jsonOption string) encryption.EncryptDriver
- func (t *PwdSha512) ShortHelp() string
Constants ¶
const DriverName = "SHA512"
DriverName Specifies the specific identity of this driver within a group
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register()
Register is a simple wrapper to make sure registration occurs properly
func SetDefault ¶
func SetDefault()
SetDefault will set THIS driver as the default encryption driver.
Types ¶
type PwdSha512 ¶
PwdSha512 defines the values required for performing encryption
func New ¶
func New() *PwdSha512
New creates a SHA512 encryption object. The salt is given a static string but can be set up on selection from the driver. This must be the same with every load or you won't be able to verify credentials.
func (*PwdSha512) ComparePasswords ¶
ComparePasswords must check to see if the passed password is equal to the stored password
func (*PwdSha512) EncryptPassword ¶
EncryptPassword will encrypt the password using the user's salt and our salt. This will be re-iterated for 'cost' number of times. This should be sufficient to protect it but still allow us to re-create later on. (The internal salt must never alter for the life of the record)
func (*PwdSha512) Setup ¶
func (t *PwdSha512) Setup(jsonOption string) encryption.EncryptDriver
Setup should be called when the driver has been selected for use. The options are cross-encryption.. See the encryption for what these are.