Documentation ¶
Index ¶
- Constants
- func Register()
- func SetDefault()
- type PwdBcrypt
- func (t *PwdBcrypt) ComparePasswords(hashedPassword, clearPassword, userSalt string) bool
- func (t *PwdBcrypt) EncryptPassword(clearPassword, userSalt string) string
- func (t *PwdBcrypt) Id() string
- func (t *PwdBcrypt) LongHelp() string
- func (t *PwdBcrypt) Setup(jsonOptions string) encryption.EncryptDriver
- func (t *PwdBcrypt) ShortHelp() string
Constants ¶
View Source
const ( // DriverName Specifies the specific identity of this driver within a group DriverName = "bcrypt" IdentityStorage = "BCrypt" HelpShort = "Standard high-quality encryption using BCRYPT methods" HelpTemplate = `` /* 1020-byte string literal not displayed */ )
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()
Types ¶
type PwdBcrypt ¶
func New ¶
func New() *PwdBcrypt
New will create a BCRYPT strucutre. 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 login anymore.
func (*PwdBcrypt) ComparePasswords ¶
ComparePasswords must be called with a bcrypt password.
func (*PwdBcrypt) EncryptPassword ¶
EncryptPassword will encrypt the password using the magic number within the record. This should be sufficient to protect it but still allow us to re-create later on. (The magic number will never alter for the life of the record
func (*PwdBcrypt) Setup ¶
func (t *PwdBcrypt) Setup(jsonOptions string) encryption.EncryptDriver
Setup should be called only when the driver has been selected for use.
Click to show internal directories.
Click to hide internal directories.