Documentation ¶
Index ¶
- Constants
- func Argon2KeyGen(password string, salt []byte, keyLen int) ([]byte, error)
- func GenerateSalt(size int) ([]byte, error)
- func GetKeyIDFromJWT(token keyaccess.JWT) (string, error)
- func GetMethodForDID(did string) (didsdk.Method, error)
- func Is2xxResponse(statusCode int) bool
- func IsStructPtr(obj any) bool
- func ParseJWT(token keyaccess.JWT) (*jws.Signature, jwt.Token, error)
- func SanitizeLog(log string) string
- func XChaCha20Poly1305Decrypt(key, data []byte) ([]byte, error)
- func XChaCha20Poly1305Encrypt(key, data []byte) ([]byte, error)
Constants ¶
const ( // Argon2SaltSize represents the recommended salt size for argon2, which is 16 bytes // https://tools.ietf.org/id/draft-irtf-cfrg-argon2-05.html#rfc.section.3.1 Argon2SaltSize = 16 )
Variables ¶
This section is empty.
Functions ¶
func Argon2KeyGen ¶
Argon2KeyGen returns an encoded string generation of a key generated using the go crypto argon2 impl specifically, the Argon2id version, a "hybrid version of Argon2 combining Argon2i and Argon2d."
func GenerateSalt ¶
GenerateSalt generates a random salt value for a given size
func GetMethodForDID ¶
GetMethodForDID gets a DID method from a did, the second part of the did (e.g. did:test:abcd, the method is 'test')
func Is2xxResponse ¶
Is2xxResponse returns true if the given status code is a 2xx response
func IsStructPtr ¶
IsStructPtr checks if the given object is a pointer to a struct
func SanitizeLog ¶
SanitizeLog prevents certain classes of injection attacks before logging https://codeql.github.com/codeql-query-help/go/go-log-injection/
func XChaCha20Poly1305Decrypt ¶
XChaCha20Poly1305Decrypt takes a 32 byte key and uses XChaCha20-Poly1305 to decrypt a piece of data
func XChaCha20Poly1305Encrypt ¶
XChaCha20Poly1305Encrypt takes a 32 byte key and uses XChaCha20-Poly1305 to encrypt a piece of data
Types ¶
This section is empty.