rsa

package
v0.0.0-...-6e49935 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToHexString

func BytesToHexString(b []byte) string

func Decode

func Decode(src string) []byte

func DecodeString

func DecodeString(src string) string

func Encode

func Encode(src []byte) string

func EncodeString

func EncodeString(src string) string

func GenRsaKeys

func GenRsaKeys(bits int) (privateKey, publicKey []byte, err error)

func Hash

func Hash(src []byte) []byte

func HashString

func HashString(str string) string

func HexStringToBytes

func HexStringToBytes(s string) []byte

Types

type RsaClient

type RsaClient struct {
	// contains filtered or unexported fields
}

func MustNewClient

func MustNewClient(publicKey []byte) *RsaClient

func NewClient

func NewClient(publicKey []byte) (*RsaClient, error)

func (*RsaClient) Encrypt

func (this *RsaClient) Encrypt(plaintext []byte) ([]byte, error)

func (*RsaClient) Verify

func (this *RsaClient) Verify(src []byte, sign []byte, hash crypto.Hash) error

func (*RsaClient) VerifyDefault

func (this *RsaClient) VerifyDefault(src []byte, sign []byte) error

type RsaServer

type RsaServer struct {
	// contains filtered or unexported fields
}

func MustNewServer

func MustNewServer(privateKey []byte) *RsaServer

func NewServer

func NewServer(privateKey []byte) (*RsaServer, error)

func (*RsaServer) Decrypt

func (this *RsaServer) Decrypt(ciphertext []byte) ([]byte, error)

func (*RsaServer) Sign

func (this *RsaServer) Sign(src []byte, hash crypto.Hash) ([]byte, error)

func (*RsaServer) SignDefault

func (this *RsaServer) SignDefault(src []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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