Documentation ¶
Index ¶
- type AuthKeys
- type AuthSeed
- type UsersAuth
- func (a UsersAuth) DecryptWithPrivateKey(ciphertext []byte, privKey *rsa.PrivateKey) (string, error)
- func (a UsersAuth) EncryptAES(key []byte, plaintext string) (string, error)
- func (a UsersAuth) EncryptWithPublicKey(msg string, pubKey *rsa.PublicKey) ([]byte, error)
- func (a UsersAuth) GenerateAuthSeed(aesKey string) (string, error)
- func (a UsersAuth) GenerateKeys(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func (a UsersAuth) GenerateRandPasswd() (string, error)
- func (a UsersAuth) GenerateRandSeed() int64
- func (a UsersAuth) LoadPrivateKey(path string) (*rsa.PrivateKey, error)
- func (a UsersAuth) RSADecrypt(ciphertext string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UsersAuth ¶
type UsersAuth struct {
// contains filtered or unexported fields
}
func NewUsersAuth ¶
func (UsersAuth) DecryptWithPrivateKey ¶
func (a UsersAuth) DecryptWithPrivateKey(ciphertext []byte, privKey *rsa.PrivateKey) (string, error)
基于私钥解密
func (UsersAuth) EncryptAES ¶
func (UsersAuth) EncryptWithPublicKey ¶
基于公钥加密
func (UsersAuth) GenerateAuthSeed ¶
func (UsersAuth) GenerateKeys ¶
生成密钥对
func (UsersAuth) GenerateRandPasswd ¶
func (UsersAuth) GenerateRandSeed ¶
func (UsersAuth) LoadPrivateKey ¶
func (a UsersAuth) LoadPrivateKey(path string) (*rsa.PrivateKey, error)
loadPrivateKey 从文件中加载 RSA 私钥
Click to show internal directories.
Click to hide internal directories.