Documentation
¶
Index ¶
- Variables
- func ParsePrivateJWK(s string) (*rsa.PrivateKey, error)
- func ParsePrivatePEMKey(s string) (*rsa.PrivateKey, error)
- func ParseRSAKey(s string) (*rsa.PrivateKey, error)
- type Argon2LimitsConfig
- type BcryptLimitsConfig
- type Crypter
- type Decrypter
- type DecrypterFunc
- type Drupal7LimitsConfig
- type Encrypter
- type HashConfig
- type HashLimitsConfig
- type HashMode
- type HashName
- type HashValidator
- type HashVerifier
- type Hasher
- type HasherConfig
- type InverseCrypter
- type PBKDF2LimitsConfig
- type PHPassLimitsConfig
- type PasswapHasher
- type ScryptLimitsConfig
- type Sha2LimitsConfig
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ParsePrivateJWK ¶
func ParsePrivateJWK(s string) (*rsa.PrivateKey, error)
func ParsePrivatePEMKey ¶
func ParsePrivatePEMKey(s string) (*rsa.PrivateKey, error)
func ParseRSAKey ¶
func ParseRSAKey(s string) (*rsa.PrivateKey, error)
Types ¶
type Argon2LimitsConfig ¶
type BcryptLimitsConfig ¶
type DecrypterFunc ¶
type Drupal7LimitsConfig ¶
type HashConfig ¶
type HashConfig struct {
Verifiers []HashName
Hasher HasherConfig
Limits HashLimitsConfig
}
func (*HashConfig) NewHasher ¶
func (c *HashConfig) NewHasher() (*PasswapHasher, error)
type HashLimitsConfig ¶
type HashLimitsConfig struct {
Bcrypt BcryptLimitsConfig
Argon2 Argon2LimitsConfig
Scrypt ScryptLimitsConfig
PBKDF2 PBKDF2LimitsConfig
Sha2 Sha2LimitsConfig
PHPass PHPassLimitsConfig
Drupal7 Drupal7LimitsConfig
}
type HashName ¶
type HashName string
const ( HashNameArgon2 HashName = "argon2" // used for the common argon2 verifier HashNameArgon2i HashName = "argon2i" // hash only HashNameArgon2id HashName = "argon2id" // hash only HashNameBcrypt HashName = "bcrypt" // hash and verify HashNameMd5 HashName = "md5" // verify only, as hashing with md5 is insecure and deprecated HashNameMd5Plain HashName = "md5plain" // verify only, as hashing with md5 is insecure and deprecated HashNameMd5Salted HashName = "md5salted" // verify only, as hashing with md5 is insecure and deprecated HashNamePHPass HashName = "phpass" // verify only, as hashing with md5 is insecure and deprecated HashNameSha2 HashName = "sha2" // hash and verify HashNameScrypt HashName = "scrypt" // hash and verify HashNamePBKDF2 HashName = "pbkdf2" // hash and verify HashNameDrupal7 HashName = "drupal7" // verify only, Drupal 7 legacy hashes )
type HashValidator ¶
type HashVerifier ¶
type HasherConfig ¶
type InverseCrypter ¶
type InverseCrypter struct {
}
InverseCrypter is an implementation of Crypter which can be used for testing purposes. The encrypted value is the bitwise inverse of the original.
type PBKDF2LimitsConfig ¶
type PHPassLimitsConfig ¶
type PasswapHasher ¶
func (*PasswapHasher) EncodingSupported ¶
func (h *PasswapHasher) EncodingSupported(encodedHash string) bool
func (*PasswapHasher) ValidateHash ¶
func (h *PasswapHasher) ValidateHash(encoded string) error
ValidateHash checks that encoded is parseable by a configured verifier and that its cost parameters are within configured bounds. Use when accepting pre-encoded hashes from untrusted sources (import, create with hash).
func (*PasswapHasher) VerifyHash ¶
func (h *PasswapHasher) VerifyHash(encoded string, target string) error
type ScryptLimitsConfig ¶
Click to show internal directories.
Click to hide internal directories.