signature

package
v0.0.0-...-7a3883e Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignFieldsSortNone = SignFieldsSortType(0)
	SignFieldsSortAsc  = SignFieldsSortType(1)
	SignFieldsSortDesc = SignFieldsSortType(-1)

	SignFieldsFormattingModeDefault = 0
	DefaultSignatureField           = "sign"

	SerializingTypeJSON = "json"
	SerializingTypeXML  = "xml"
)

Consts

Variables

This section is empty.

Functions

func FormatSignatureContent

func FormatSignatureContent(params map[string]interface{}, configures ...SigningOption) string

FormatSignatureContent formatting content

func FormatSignatureContentEx

func FormatSignatureContentEx(payload interface{}, configures ...SigningOption) string

FormatSignatureContentEx formatting content

func GeneratePayloadMappingData

func GeneratePayloadMappingData(value reflect.Value, parentTagName string) map[string]interface{}

GeneratePayloadMappingData generates payload data

func GenerateSignatureDataHmacMD5

func GenerateSignatureDataHmacMD5(appKey string, params map[string]interface{}, configures ...SigningOption) string

GenerateSignatureDataHmacMD5 MD5

func GenerateSignatureDataHmacMD5Ex

func GenerateSignatureDataHmacMD5Ex(appKey string, payload interface{}, configures ...SigningOption) string

GenerateSignatureDataHmacMD5Ex MD5

func GenerateSignatureDataHmacSHA1

func GenerateSignatureDataHmacSHA1(appKey string, params map[string]interface{}, configures ...SigningOption) string

GenerateSignatureDataHmacSHA1 SHA1

func GenerateSignatureDataHmacSHA1Ex

func GenerateSignatureDataHmacSHA1Ex(appKey string, payload interface{}, configures ...SigningOption) string

GenerateSignatureDataHmacSHA1Ex SHA1

func GenerateSignatureDataMd5

func GenerateSignatureDataMd5(appKey string, params map[string]interface{}, configures ...SigningOption) string

GenerateSignatureDataMd5 MD5

func GenerateSignatureDataMd5Ex

func GenerateSignatureDataMd5Ex(appKey string, payload interface{}, configures ...SigningOption) string

GenerateSignatureDataMd5Ex MD5

func GenerateSignatureDataSHA1

func GenerateSignatureDataSHA1(appKey string, params map[string]interface{}, configures ...SigningOption) string

GenerateSignatureDataSHA1 SHA1

func VerifySignatureDataHmacMD5

func VerifySignatureDataHmacMD5(signValue string, appKey string, params map[string]interface{}, configures ...SigningOption) bool

VerifySignatureDataHmacMD5 MD5

func VerifySignatureDataHmacSHA1

func VerifySignatureDataHmacSHA1(signValue string, appKey string, params map[string]interface{}, configures ...SigningOption) bool

VerifySignatureDataHmacSHA1 SHA1

func VerifySignatureDataMd5

func VerifySignatureDataMd5(signValue string, appKey string, params map[string]interface{}, configures ...SigningOption) bool

VerifySignatureDataMd5 MD5

func VerifySignatureDataRSA

func VerifySignatureDataRSA(pubKey *rsa.PublicKey, hash crypto.Hash, params map[string]interface{}, sign string, configures ...SigningOption) error

VerifySignatureDataRSA RSA

func VerifySignatureDataRSAEx

func VerifySignatureDataRSAEx(pubKey *rsa.PublicKey, hash crypto.Hash, content string, sign []byte) error

VerifySignatureDataRSAEx RSA

func VerifySignatureDataSHA1

func VerifySignatureDataSHA1(signValue string, appKey string, params map[string]interface{}, configures ...SigningOption) bool

VerifySignatureDataSHA1 SHA1

Types

type SignFieldsSortType

type SignFieldsSortType int

SignFieldsSortType signature fields sorting type

type SigningOption

type SigningOption interface {
	// contains filtered or unexported methods
}

SigningOption customizing options

func WithSignatureField

func WithSignatureField(field string) SigningOption

WithSignatureField option

func WithSignaturingFields

func WithSignaturingFields(fields []string) SigningOption

WithSignaturingFields option

func WithSkipEmptyField

func WithSkipEmptyField(skip bool) SigningOption

WithSkipEmptyField option

func WithSkipSignaturingField

func WithSkipSignaturingField(key string) SigningOption

WithSkipSignaturingField option

func WithSortedFields

func WithSortedFields(sortType SignFieldsSortType) SigningOption

WithSortedFields option

Jump to

Keyboard shortcuts

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