Documentation ¶
Index ¶
- Variables
- func GenerateKey(secret, salt string, digest Digest) []byte
- func GenerateKeyWithOptions(secret, salt string, iter, size int, hgen HashFunc) []byte
- func GenerateToken(key []byte, digest Digest) (string, string)
- func NewCertPoolFromCertificatesInDirectory(dir string) (*x509.CertPool, error)
- func PKCS5Pad(in []byte) []byte
- func PKCS5Unpad(in []byte) []byte
- func SecureCompare(a, b string) bool
- func Sign(key []byte, digest Digest, data []byte) string
- func SignMessage(key []byte, digest Digest, message interface{}) (string, string, error)
- func Verify(key []byte, digest Digest, sig string, data []byte) bool
- func VerifyMessage(key []byte, digest Digest, sig string, message interface{}, data string) error
- type Digest
- type HashFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSignatureNotValid = fmt.Errorf("Signature not valid")
Functions ¶
func GenerateKey ¶
Generate a Rails-compatible key
func GenerateKeyWithOptions ¶
Generate a key with options
func GenerateToken ¶
Generate a Devise-compatible general-purpose secure token
func NewCertPoolFromCertificatesInDirectory ¶
Create a certificate pool containing all the certificates found in the specified directory.
func SignMessage ¶
Produce a serialized, base64-encoded message and its signature
Types ¶
Click to show internal directories.
Click to hide internal directories.