secret

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aes added in v1.1.1

type Aes struct{}
var AesHelper Aes

func (Aes) DecryptCBC added in v1.1.1

func (Aes) DecryptCBC(cipherText, key, iv []byte, ivs ...[]byte) ([]byte, error)

func (Aes) EncryptCBC added in v1.1.1

func (Aes) EncryptCBC(plainText, key, iv []byte, ivs ...[]byte) ([]byte, error)

func (Aes) New added in v1.1.1

func (Aes) New() *Aes

func (Aes) PKCS7Padding added in v1.1.1

func (Aes) PKCS7Padding(src []byte, blockSize int) []byte

func (Aes) PKCS7UnPadding added in v1.1.1

func (Aes) PKCS7UnPadding(src []byte, blockSize int) ([]byte, error)

type PemBase64 added in v1.1.1

type PemBase64 struct {
	// contains filtered or unexported fields
}
var PemBase64Helper PemBase64

func (*PemBase64) GeneratePemPrivateKey added in v1.1.1

func (r *PemBase64) GeneratePemPrivateKey() (*PemBase64, error)

func (*PemBase64) GeneratePemPublicKey added in v1.1.1

func (r *PemBase64) GeneratePemPublicKey() (*PemBase64, error)

func (*PemBase64) GetBase64PrivateKey added in v1.1.1

func (r *PemBase64) GetBase64PrivateKey() string

func (*PemBase64) GetBase64PublicKey added in v1.1.1

func (r *PemBase64) GetBase64PublicKey() string

func (*PemBase64) GetPemPrivateKey added in v1.1.1

func (r *PemBase64) GetPemPrivateKey() []byte

func (*PemBase64) GetPemPublicKey added in v1.1.1

func (r *PemBase64) GetPemPublicKey() []byte

func (PemBase64) New added in v1.1.1

func (PemBase64) New() *PemBase64

func (*PemBase64) SetBase64PrivateKye added in v1.1.1

func (r *PemBase64) SetBase64PrivateKye(base64PrivateKye string) *PemBase64

func (*PemBase64) SetBase64PublicKey added in v1.1.1

func (r *PemBase64) SetBase64PublicKey(base64PublicKey string) *PemBase64

type Rsa

type Rsa struct{}
var (
	RsaHelper Rsa
)

func (*Rsa) DecryptByBase64 added in v1.1.0

func (r *Rsa) DecryptByBase64(base64PrivateKey string, cipherText []byte) ([]byte, error)

func (*Rsa) DecryptByPem added in v1.1.0

func (*Rsa) DecryptByPem(pemPrivateKey []byte, cipherText []byte) []byte

DecryptByPem 使用PEM私钥进行RSA解密

func (*Rsa) EncryptByBase64 added in v1.0.9

func (r *Rsa) EncryptByBase64(base64PublicKey string, plainText []byte) ([]byte, error)

EncryptByBase64 通过base64公钥加密

func (*Rsa) EncryptByPem added in v1.1.0

func (*Rsa) EncryptByPem(pemPublicKey []byte, plainText []byte) []byte

EncryptByPem 通过pem公钥加密

func (Rsa) New

func (Rsa) New() *Rsa

New 实例化:Rsa加密

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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