Documentation ¶
Index ¶
- type PemBase64
- func (r *PemBase64) GeneratePemPrivateKey() (*PemBase64, error)
- func (r *PemBase64) GeneratePemPublicKey() (*PemBase64, error)
- func (r *PemBase64) GetBase64PrivateKey() string
- func (r *PemBase64) GetBase64PublicKey() string
- func (r *PemBase64) GetPemPrivateKey() []byte
- func (r *PemBase64) GetPemPublicKey() []byte
- func (PemBase64) New() *PemBase64
- func (r *PemBase64) SetBase64PrivateKye(base64PrivateKye string) *PemBase64
- func (r *PemBase64) SetBase64PublicKey(base64PublicKey string) *PemBase64
- type Rsa
- func (r Rsa) DecryptByBase64(base64PrivateKey string, cipherText []byte) ([]byte, error)
- func (Rsa) DecryptByPem(pemPrivateKey []byte, cipherText []byte) ([]byte, error)
- func (r Rsa) Demo()
- func (r Rsa) EncryptByBase64(base64PublicKey string, plainText []byte) ([]byte, error)
- func (Rsa) EncryptByPem(pemPublicKey []byte, plainText []byte) ([]byte, error)
- func (Rsa) New() *Rsa
- type UnEncrypt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PemBase64 ¶
type PemBase64 struct {
// contains filtered or unexported fields
}
var PemBase64Helper PemBase64
func (*PemBase64) GeneratePemPrivateKey ¶
GeneratePemPrivateKey 生成pem密钥
func (*PemBase64) GeneratePemPublicKey ¶
func (*PemBase64) GetBase64PrivateKey ¶
func (*PemBase64) GetBase64PublicKey ¶
func (*PemBase64) GetPemPrivateKey ¶
GetPemPrivateKey 获取pem私钥
func (*PemBase64) GetPemPublicKey ¶
func (*PemBase64) SetBase64PrivateKye ¶
func (*PemBase64) SetBase64PublicKey ¶
type Rsa ¶
type Rsa struct{}
var RsaHelper Rsa
func (Rsa) DecryptByBase64 ¶
DecryptByBase64 通过base64私钥解密
func (Rsa) DecryptByPem ¶
DecryptByPem 使用PEM私钥进行RSA解密
func (Rsa) EncryptByBase64 ¶
EncryptByBase64 通过base64公钥加密
func (Rsa) EncryptByPem ¶
EncryptByPem 通过pem公钥加密
Click to show internal directories.
Click to hide internal directories.