password

package
v1.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package password provides utilities for password hashing and verification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SCRAMSHA1VariationHash added in v1.22.0

func SCRAMSHA1VariationHash(username string, password Password) (*bson.Document, error)

SCRAMSHA1VariationHash computes a variation of SCRAM-SHA-1 and returns a document containing stored key, iteration count, salt, and server key.

It does not conform to the SCRAM-SHA-1 standard due to the custom preparation of the password.

func SCRAMSHA256Hash added in v1.20.0

func SCRAMSHA256Hash(password Password) (*bson.Document, error)

SCRAMSHA256Hash computes SCRAM-SHA-256 credentials and returns a document containing stored key, iteration count, salt, and server key.

Types

type Password added in v1.22.0

type Password struct {
	// contains filtered or unexported fields
}

Password wraps a password string.

It exist mainly to avoid issues when multiple string parameters are used.

It should be passed by value.

func WrapPassword added in v1.22.0

func WrapPassword(password string) Password

WrapPassword returns Password for the given string.

func (Password) Empty added in v1.22.0

func (p Password) Empty() bool

Empty return true if password in an empty string.

func (Password) Password added in v1.22.0

func (p Password) Password() string

Password returns the password string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL