crypto

package
v1.0.76 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher

type Cipher interface {
	GetPrivateKey() (interface{}, string)
	GetPublicKey() (interface{}, string)
	Encrypt(msg []byte) (string, error)
	Decrypt(msg string) (string, error)
	Sign(msg []byte) ([]byte, error)
	Verify(msg, sign []byte) error
}

type EccObj

type EccObj struct {
	PrivateKeyBase64 string
	PublicKeyBase64  string
	// contains filtered or unexported fields
}

func (*EccObj) CreateS256ECC

func (self *EccObj) CreateS256ECC() error

func (*EccObj) Decrypt

func (self *EccObj) Decrypt(msg string) (string, error)

func (*EccObj) Encrypt

func (self *EccObj) Encrypt(msg []byte) (string, error)

func (*EccObj) GetPrivateKey

func (self *EccObj) GetPrivateKey() (interface{}, string)

func (*EccObj) GetPublicKey

func (self *EccObj) GetPublicKey() (interface{}, string)

func (*EccObj) Sign

func (self *EccObj) Sign(msg []byte) ([]byte, error)

func (*EccObj) Verify

func (self *EccObj) Verify(msg, sign []byte) error

type RsaObj

type RsaObj struct {
	PrivateKeyBase64 string
	PublicKeyBase64  string
	// contains filtered or unexported fields
}

func (*RsaObj) CreateRsa1024

func (self *RsaObj) CreateRsa1024() error

func (*RsaObj) CreateRsa2048

func (self *RsaObj) CreateRsa2048() error

func (*RsaObj) CreateRsaFile

func (self *RsaObj) CreateRsaFile(keyfile, pemfile string) error

func (*RsaObj) CreateRsaFileBase64

func (self *RsaObj) CreateRsaFileBase64(b ...int) error

func (*RsaObj) CreateRsaPemFile

func (self *RsaObj) CreateRsaPemFile(pemfile string) error

func (*RsaObj) Decrypt

func (self *RsaObj) Decrypt(msg string) (string, error)

func (*RsaObj) Encrypt

func (self *RsaObj) Encrypt(msg []byte) (string, error)

func (*RsaObj) GetPrivateKey

func (self *RsaObj) GetPrivateKey() (interface{}, string)

func (*RsaObj) GetPublicKey

func (self *RsaObj) GetPublicKey() (interface{}, string)

func (*RsaObj) LoadRsaFile

func (self *RsaObj) LoadRsaFile(filePath string) error

func (*RsaObj) LoadRsaKeyFileBase64

func (self *RsaObj) LoadRsaKeyFileBase64(fileBase64 string) error

func (*RsaObj) LoadRsaPemFile

func (self *RsaObj) LoadRsaPemFile(filePath string) error

func (*RsaObj) LoadRsaPemFileBase64

func (self *RsaObj) LoadRsaPemFileBase64(fileBase64 string) error

func (*RsaObj) Sign

func (self *RsaObj) Sign(msg []byte) ([]byte, error)

func (*RsaObj) Verify

func (self *RsaObj) Verify(msg, sign []byte) error

Jump to

Keyboard shortcuts

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