Documentation
¶
Index ¶
- func DecData(r io.Reader, w io.Writer, priKey []byte, h hash.Hash) error
- func EncData(r io.Reader, w io.Writer, pubKey []byte, h hash.Hash) error
- func GenRsaKey(bits int, pub, pri io.Writer) error
- func RsaDecrypt(priKey, cipherText []byte) ([]byte, error)
- func RsaEncrypt(pubKey, origData []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecData ¶
DecData
@Description: 解密数据 @param r 密文数据读入流 @param w 解密后数据写入流 @param priKey 私钥数据 @param h 指定hash校验方法 @return error 返回错误
func EncData ¶
EncData
@Description: 加密数据 @param r 数据来源读出流 @param w 加密数据写入流 @param pubKey 公钥数据 @param h 指定hash校验方法 @return error 返回错误
func GenRsaKey ¶
GenRsaKey
@Description: 生成rsa公私钥对 @param bits 生成位数 @param pub 公钥写入流 @param pri 私钥写入流 @return error 返回错误
func RsaDecrypt ¶
RsaDecrypt
@Description: rsa解密逻辑 @param priKey 私钥数据 @param cipherText 密文 @return []byte 解密后数据 @return error 返回错误
func RsaEncrypt ¶
RsaEncrypt
@Description: rsa加密逻辑 @param pubKey 公钥数据 @param origData 待加密数据 @return []byte 返回加密后数据 @return error 返回错误
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.