service

package
v0.0.0-...-4c71352 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeArgon2id

func EncodeArgon2id(secret []byte) (string, error)

func GenerateRandomBytes

func GenerateRandomBytes(len int) ([]byte, error)

func VerifyArgon2id

func VerifyArgon2id(encoded string, secret []byte) bool

Types

type Argon2IdKey

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

func NewArgon2IdKeyFromSecret

func NewArgon2IdKeyFromSecret(secret []byte) (Argon2IdKey, error)

func NewArgon2IdKeyFromString

func NewArgon2IdKeyFromString(encoded string) (Argon2IdKey, error)

func (Argon2IdKey) String

func (k Argon2IdKey) String() string

func (Argon2IdKey) Verify

func (k Argon2IdKey) Verify(secret []byte) bool

type Argon2Params

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

func (Argon2Params) IDKey

func (p Argon2Params) IDKey(secret []byte) ([]byte, error)

type KeyAndIv

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

func NewKeyAndIv

func NewKeyAndIv() (KeyAndIv, error)

func NewKeyAndIvFromBytes

func NewKeyAndIvFromBytes(b []byte) (KeyAndIv, error)

func (KeyAndIv) Decrypt

func (k KeyAndIv) Decrypt(b []byte) ([]byte, error)

func (KeyAndIv) Encrypt

func (k KeyAndIv) Encrypt(b []byte) ([]byte, error)

func (KeyAndIv) ToBytes

func (k KeyAndIv) ToBytes() []byte

type SessionJwtClaims

type SessionJwtClaims struct {
	SessionId     string
	EncryptionKey []byte
}

type SessionJwtConverter

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

func NewSessionJwtConverter

func NewSessionJwtConverter(kid string, priv *rsa.PrivateKey, pub map[string]*rsa.PublicKey) *SessionJwtConverter

func (*SessionJwtConverter) ReadJWT

func (c *SessionJwtConverter) ReadJWT(jwtStr string) (SessionJwtClaims, time.Time, error)

func (*SessionJwtConverter) WriteJWT

func (c *SessionJwtConverter) WriteJWT(claims SessionJwtClaims, exp time.Time) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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