logic

package
v0.0.0-...-20fd351 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenRsaKey

func GenRsaKey() ([]byte, []byte, error)

GenRsaKey generate private key and public key

func RsaDec

func RsaDec(ciphertext, privKey []byte) ([]byte, error)

RsaDec decrypt

func RsaEnc

func RsaEnc(plaintext, pubKey []byte) ([]byte, error)

RsaEnc encrypt

func RsaSign

func RsaSign(data, privKey []byte) ([]byte, error)

RsaSign sign

func RsaVerify

func RsaVerify(data, sign, pubKey []byte) error

RsaVerify verify sign

Types

type AuthService

type AuthService interface {
	CreateUser(req *entity.UserReq) error
	DeleteUser(req *entity.UserReq) error
	CreateRole(req *entity.RoleReq) error
	DeleteRole(req *entity.RoleReq) error
	AddRoleToUser(req *entity.UserRoleReq) error
	Authenticate(req *entity.UserRoleReq) (*entity.UserRoleRsp, error)
	Invalidate(req *entity.UserRoleReq) error
	CheckRole(req *entity.UserRoleReq) (*entity.UserRoleRsp, error)
	AllRoles(req *entity.UserRoleReq) (*entity.UserRoleRsp, error)
}

AuthService service interface

func NewServie

func NewServie(privKey, pubKey []byte) AuthService

NewServie new service

Jump to

Keyboard shortcuts

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