Documentation ¶
Overview ¶
* @Author: cnzf1 * @Date: 2021-08-05 17:31:50
- @LastEditors: cnzf1
- @LastEditTime: 2023-03-01 16:49:29
* @Description:
Index ¶
- Variables
- func MarshalPKCS8PrivateKey(key *rsa.PrivateKey) []byte
- type Crypter
- type Decrypter
- type Encrypter
- type Rsa
- func (this *Rsa) Decrypt(encData []byte) ([]byte, error)
- func (this *Rsa) DecryptBase64(encData string) ([]byte, error)
- func (this *Rsa) DecryptBase64Ex(encData string) ([]byte, error)
- func (this *Rsa) DecryptEx(encData []byte) ([]byte, error)
- func (this *Rsa) Encrypt(rawData []byte) ([]byte, error)
- func (this *Rsa) EncryptBase64(rawData []byte) (string, error)
- func (this *Rsa) EncryptBase64Ex(rawData []byte) (string, error)
- func (this *Rsa) EncryptEx(rawData []byte) ([]byte, error)
- func (this *Rsa) Sign(rawData []byte, algorithmSign crypto.Hash) ([]byte, error)
- func (this *Rsa) Verify(rawData []byte, sign []byte, algorithmSign crypto.Hash) bool
- type Signer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func MarshalPKCS8PrivateKey ¶
func MarshalPKCS8PrivateKey(key *rsa.PrivateKey) []byte
Types ¶
type Decrypter ¶
type Decrypter interface { Decrypt(encData []byte) ([]byte, error) DecryptBase64(encData string) ([]byte, error) }
Decrypter represents a RSA decrypter.
type Encrypter ¶
type Encrypter interface { Encrypt(rawData []byte) ([]byte, error) EncryptBase64(rawData []byte) (string, error) }
Encrypter represents a RSA encrypter.
type Rsa ¶
type Rsa struct {
// contains filtered or unexported fields
}
func (*Rsa) DecryptBase64 ¶
私钥解密+base64解码
func (*Rsa) DecryptBase64Ex ¶
公钥解密+base64解码
func (*Rsa) EncryptBase64 ¶
公钥加密+base64编码
func (*Rsa) EncryptBase64Ex ¶
私钥加密+base64编码
Click to show internal directories.
Click to hide internal directories.