Documentation ¶
Index ¶
- func GenRsaKey() ([]byte, []byte, error)
- func ParserPrivateKey(key []byte) (*rsa.PrivateKey, error)
- func ParserPublicKey(key []byte) (*rsa.PublicKey, error)
- type Encryptor
- type RsaCipher
- func (r *RsaCipher) Decrypt(cipherText []byte) ([]byte, error)
- func (r *RsaCipher) DecryptToString(cipherText string) (string, error)
- func (r *RsaCipher) Encrypt(plainText []byte) ([]byte, error)
- func (r *RsaCipher) EncryptToString(plainText string) (string, error)
- func (r *RsaCipher) Sign(text []byte) ([]byte, error)
- func (r *RsaCipher) VerifySign(text, signature []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParserPrivateKey ¶
func ParserPrivateKey(key []byte) (*rsa.PrivateKey, error)
ParserPrivateKey 解析私钥
Types ¶
type Encryptor ¶
type Encryptor interface { EncryptToString(plaintext string) (string, error) DecryptToString(ciphertext string) (string, error) }
Encryptor ...
type RsaCipher ¶
type RsaCipher struct {
// contains filtered or unexported fields
}
RsaCipher rsa加解密
func NewRsaCipher ¶
NewRsaCipher rsa加解密
func NewRsaCipherBase64 ¶
NewRsaCipherBase64 rsa加解密
func (*RsaCipher) DecryptToString ¶
func (*RsaCipher) EncryptToString ¶
Click to show internal directories.
Click to hide internal directories.