utils

package
v0.0.0-...-2de47e0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package utils Copyright: Copyright (c) 2020<br> Company: 易宝支付(YeePay)<br> @author : yunmei.wu @time : 2023/3/15 2:22 PM

Package utils Copyright: Copyright (c) 2020<br> Company: 易宝支付(YeePay)<br> @author : yunmei.wu @time : 2023/3/20 4:15 PM

Package utils Copyright: Copyright (c) 2020<br> Company: 易宝支付(YeePay)<br> @author : yunmei.wu @time : 2023/3/29 9:56 AM

Package utils Copyright: Copyright (c) 2020<br> Company: 易宝支付(YeePay)<br> @author : yunmei.wu @time : 2023/3/14 10:23 AM

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecryptECB

func AesDecryptECB(encrypted []byte, key []byte) (decrypted []byte)

func DecryptCallback

func DecryptCallback(platformPubKey string, isvPriKey string, callBack string) (string, error)

DecryptCallback 解密回调通知内容

func EncodeParameters

func EncodeParameters(params map[string][]string, forSign bool) string

func FormatPemKey

func FormatPemKey(yopFormKey string, pemHeader string) string

FormatPemKey /**

func GetCanonicalQueryString

func GetCanonicalQueryString(params map[string][]string) string

func Normalize

func Normalize(value string) string

func NormalizePath

func NormalizePath(path string) string

func ParsePrivateKey

func ParsePrivateKey(privateKey string) (any, error)

func ParsePublicKey

func ParsePublicKey(publicKey string) (*rsa.PublicKey, error)

func ParseToJsonStr

func ParseToJsonStr(params map[string]any) string

func RsaDecrypt

func RsaDecrypt(priKey string, cipher string) ([]byte, error)

func RsaSignBase64

func RsaSignBase64(content string, privateKey string, hash crypto.Hash) (string, error)

RsaSignBase64 base64UrlEncode签名

func Sign

func Sign(content string, privateKey string, hash crypto.Hash) ([]byte, error)

Sign rsa签名

func UsePayloadForQueryParameters

func UsePayloadForQueryParameters(yopRequest request.YopRequest) bool

func Verify

func Verify(content []byte, signature []byte, pub *rsa.PublicKey, hash crypto.Hash) bool

func VerifySign

func VerifySign(content string, signature string, pubKey string, hash crypto.Hash) bool

VerifySign 验签

Types

This section is empty.

Jump to

Keyboard shortcuts

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