userLogic

package
v0.0.0-...-7418c02 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogic

func NewLogic(ctx *gin.Context) *logic

func ReadRSAPrivateKey

func ReadRSAPrivateKey(readFile []byte) (*rsa.PrivateKey, error)

获取私钥

func ReadRSAPublicKey

func ReadRSAPublicKey(readFile []byte) (*rsa.PublicKey, error)

获取公钥

func RsaDecrypt

func RsaDecrypt(ciphertext []byte, prvKey *rsa.PrivateKey) []byte

私钥解密

func RsaEncrypt

func RsaEncrypt(data []byte, pub *rsa.PublicKey) []byte

公钥加密

func RsaSignWithSha256

func RsaSignWithSha256(data []byte, keyBytes []byte) []byte

签名

func RsaVerySignWithSha256

func RsaVerySignWithSha256(data, signData []byte, pubKey *rsa.PublicKey) bool

验证

Types

type PostBody

type PostBody struct {
	SearchTerm string `json:"search_term"`
	Limit      uint32 `json:"limit"`

	EncryptedData string `json:"encrypted_data"`
}

type UserSearchResPon

type UserSearchResPon struct {
	Limited bool `json:"limited"`
	Results []struct {
		UserId        string `json:"user_id"`
		DisplayName   string `json:"display_name"`
		AvatarUrl     string `json:"avatar_url"`
		WalletAddress string `json:"wallet_address"`
	} `json:"results"`
}

Jump to

Keyboard shortcuts

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