Documentation ¶
Index ¶
- func DecData(r io.Reader, w io.Writer, decMode any, h hash.Hash, gen DecCipher) error
- func EncData(r io.Reader, w io.Writer, encMode any, h hash.Hash, gen EncCipher) error
- func GenRsaKey(bits int, pub, pri io.Writer) error
- func RsaDecrypt(priKey, cipherText []byte) ([]byte, error)
- func RsaEncrypt(pubKey, origData []byte) ([]byte, error)
- func WriteFull(w io.Writer, b []byte) (n int, err error)
- type DecCipher
- type EncCipher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecData ¶
DecData
@Description: decrypt data @param r ciphertext data read stream @param w the decrypted data is written to the stream @param devMode private key data or decryption function @param h specify the hash verification method @param gen DecCipher, verify and generate a decryption algorithm based on the key @return error
func EncData ¶
EncData
@Description: encrypted data @param r data source read stream @param w encrypted data is written to the stream @param encMode public key or encryption function @param h specify the hash verification method @param gen EncCipher, generate key and specify encryption algorithm @return error
func GenRsaKey ¶
GenRsaKey
@Description: generate rsa public-private key pair @param bits generated digits @param pub public key write stream @param pri private key write stream @return error
func RsaDecrypt ¶
RsaDecrypt
@Description: rsa decryption logic @param priKey private key data @param cipherText cipher text @return []byte decrypted data @return error
func RsaEncrypt ¶
RsaEncrypt
@Description: rsa encryption logic @param pubKey public key data @param origData data to be encrypted @return []byte return encrypted data @return error
Types ¶
type DecCipher ¶ added in v1.0.7
func GenDecCipher ¶ added in v1.0.7
Click to show internal directories.
Click to hide internal directories.