Documentation ¶
Index ¶
- func Md5(src interface{}) string
- func Sha1(src interface{}) string
- type AES
- type RSA
- func (s *RSA) Decrypt(ciphertext string) (string, error)
- func (s *RSA) Encrypt(plainText string) (string, error)
- func (s *RSA) GenerateKey() error
- func (s *RSA) GenerateKeyBase64(priv *rsa.PrivateKey, pub *rsa.PublicKey) (string, string, error)
- func (s *RSA) GenerateKeyBuffer(priv *rsa.PrivateKey, pub *rsa.PublicKey) (string, string, error)
- func (s *RSA) GenerateKeyFile(privFileName, pubFileName string) error
- func (s *RSA) GenerateKeyPrivBase64(priv *rsa.PrivateKey) (string, error)
- func (s *RSA) GenerateKeyPubBase64(pub *rsa.PublicKey) (string, error)
- func (s *RSA) LoadKeyBase64(privString string) error
- func (s *RSA) LoadkeyFile(privFileName string) error
- func (s *RSA) Sign(src []byte) (string, error)
- func (s *RSA) Verify(src []byte, sign []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RSA ¶ added in v1.0.1
type RSA struct { PrivateKey *rsa.PrivateKey PublicKey *rsa.PublicKey }
func (*RSA) GenerateKey ¶ added in v1.0.1
GenerateKey RSA private/public key
func (*RSA) GenerateKeyBase64 ¶ added in v1.0.1
GenerateKeyBase64 generate RSA key to string Compared with GenerateKeyBuffer this output:
- Have no header/tailer line
- Key content is merged into one-line format
func (*RSA) GenerateKeyBuffer ¶ added in v1.0.1
GenerateKeyBuffer generate RSA key to Memory
func (*RSA) GenerateKeyFile ¶ added in v1.0.1
GenerateKeyFile generate RSA key file
func (*RSA) GenerateKeyPrivBase64 ¶ added in v1.0.1
func (s *RSA) GenerateKeyPrivBase64(priv *rsa.PrivateKey) (string, error)
func (*RSA) GenerateKeyPubBase64 ¶ added in v1.0.1
func (*RSA) LoadKeyBase64 ¶ added in v1.0.1
LoadKeyBase64 from string load key
func (*RSA) LoadkeyFile ¶ added in v1.0.1
LoadkeyFile from file load key
Click to show internal directories.
Click to hide internal directories.