alg

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAlgorithm

func RegisterAlgorithm(alg Algorithm)

Types

type Algorithm

type Algorithm interface {
	// Name The name of the algorithm
	Name() string
	// Encrypt Only pay attention to how to encrypt, return the encrypted original Signature data.
	// Don't do encoding processing; signing is a string that connects the header and the payload after encoding through the point ".".
	// 只关注如何加密, 返回加密后的原始Signature数据, 不要进行编码; signing为将header和payload编码后的通过点连接起来的字符串.
	Encrypt(signing, secret string) ([]byte, error)
}

func GetAlgorithm

func GetAlgorithm(name string) (Algorithm, error)

func HS256 added in v1.0.1

func HS256() Algorithm

HS256 returns the standard HMAC SHA-256 algorithm (RFC 7518).

func HSA256

func HSA256() Algorithm

Jump to

Keyboard shortcuts

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