Documentation ¶
Index ¶
- func CheckPassword(digest []byte, password []byte) (err error)
- func Decrypt(ct []byte, key [32]byte) (pt []byte, err error)
- func Encrypt(pt []byte, key [32]byte) (ct []byte, err error)
- func HashData(tag string, data []byte) (digest []byte)
- func HashPassword(password []byte) (digest []byte, err error)
- func NewSigningKey() (pri *ecdsa.PrivateKey, err error)
- func Sign(data []byte, pri *ecdsa.PrivateKey) (sig []byte, err error)
- func Verify(data []byte, sig []byte, pub *ecdsa.PublicKey) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
CheckPassword compares a given password against its hased equivalent and returns an error if they are not equal.
func HashData ¶
HashData performs an HMAC SHA-512/256 hash of a given input. Note that this should only be used to hash data, not passwords.
func HashPassword ¶
HashPassword performs a bcrypt hash of a given password using a constant cost value.
func NewSigningKey ¶
func NewSigningKey() (pri *ecdsa.PrivateKey, err error)
NewSigningKey generates an ECDSA P256 private key.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.