Versions in this module Expand all Collapse all v0 v0.1.1 May 28, 2024 v0.1.0 Jan 30, 2024 Changes in this version + const DefaultComplexity + const MinimumComplexity + const TextPrefix + func AddSecretsRotationCallback(callback func()) + func BanSignature(signature string) + func GetSecrets() (current, previous string) + func IsSignatureBanned(signature string) bool + func NewChallengeEncoded() string + func RotateSecrets() + func SetSecretsRotationInterval(interval time.Duration) + func Sign(algo Algorithm, text string) string + func SolveChallenge(challenge string, maximumComplexity int) (response string, ok bool) + func ValidateResponse(encoded string, preventReplay bool) (ok bool) + func VerifySignature(algo Algorithm, text string, signature string) (valid bool) + type Algorithm int + const SHA256 + const SHA384 + const SHA512 + const UnknownAlgorithm + func AlgorithmFromString(algo string) (Algorithm, bool) + func (algorithm Algorithm) String() string + type Message struct + Algorithm string + Challenge string + Number int + Salt string + Signature string + func DecodeChallenge(encoded string) (msg Message, err error) + func DecodeJSON(encoded []byte) (msg Message, err error) + func DecodeResponse(encoded string) (msg Message, err error) + func DecodeText(encoded string) (msg Message, err error) + func NewChallenge() (msg Message) + func NewChallengeWithParams(params Parameters) (msg Message) + func (message Message) Encode() string + func (message Message) EncodeWithBase64() string + func (message Message) IsValidResponse() bool + func (message Message) Solve(maximumComplexity int) (number int, ok bool) + func (message Message) String() string + type Parameters struct + Algorithm string + Complexity int + Number int + Salt string