Documentation
¶
Index ¶
- Variables
- type Hash
- type Key
- type Pbkdf2Key
- func (d *Pbkdf2Key) Equals(other string) bool
- func (*Pbkdf2Key) FromString(s string) (Key, error)
- func (d *Pbkdf2Key) GetKey() []byte
- func (d *Pbkdf2Key) GetSalt() []byte
- func (Pbkdf2Key) Key(value []byte, iter int, keyLen int, h func() hash.Hash) Key
- func (Pbkdf2Key) KeyFromStr(value string, iter int, keyLen int, h func() hash.Hash) Key
- func (d *Pbkdf2Key) String() string
- type Salt
Constants ¶
This section is empty.
Variables ¶
View Source
var PbKdf2 = Pbkdf2Key{}
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key interface {
// String convert this Key to a string in the form of `$algo;{any number of algorithm defined fields}`
String() string
// FromString read the string form of a Key into a Key implementer instance
FromString(string) (Key, error)
// Equals given the Key it's called on and a string, make a new Key with the same params as the referenced Key
// and compare them in constant time
Equals(other string) bool
GetKey() []byte
GetSalt() []byte
}
Key is the interface abstracting over the supported Key derivation functions in this package
type Pbkdf2Key ¶
Pbkdf2Key represents a key derived using the PBKDF2 algorithm. It contains the following fields: - Hash: The derived key - Salt: The salt value used for key derivation - Algo: The algorithm used for key derivation - Iter: The number of iterations used for key derivation - KeyLen: The length of the derived key - HashType: The hash function used for key derivation
func (Pbkdf2Key) KeyFromStr ¶
Click to show internal directories.
Click to hide internal directories.