Documentation ¶
Index ¶
- Variables
- func AesCBCDecryptByPKCS5UnPadding(data, secret []byte) ([]byte, error)
- func AesCBCDecryptByPKCS7UnPadding(data, secret []byte) ([]byte, error)
- func AesCBCEncryptByPKCS5Padding(data, secret []byte) ([]byte, error)
- func AesCBCEncryptByPKCS7Padding(data, secret []byte) ([]byte, error)
- func AesCFBDecrypt(data, secret []byte) ([]byte, error)
- func AesCFBEncrypt(data, secret []byte) ([]byte, error)
- func AesPKCS5Padding(src []byte, blockSize int) []byte
- func AesPKCS5UnPadding(src []byte) []byte
- func AesPKCS7Padding(cipherText []byte, blockSize int) []byte
- func AesPKCS7UnPadding(plantText []byte) []byte
- func Base64Decrypt(data string) ([]byte, error)
- func Base64Encrypt(data []byte) string
- func ECDSAGenerate(c elliptic.Curve, privateHeaders, publicHeaders map[string]string) (private, public []byte, err error)
- func ECDSAParsePrivateKey(secret []byte) (*ecdsa.PrivateKey, error)
- func ECDSAParsePublicKey(secret []byte) (*ecdsa.PublicKey, error)
- func ECDSASignature(hash crypto.Hash, private, data []byte) (r, s *big.Int, err error)
- func ECDSAVerify(hash crypto.Hash, r, s *big.Int, public, data []byte) error
- func Hash(data []byte, hash crypto.Hash) []byte
- func HashHex(data []byte, hash crypto.Hash) string
- func HmacHash(data, secret []byte, hash crypto.Hash) string
- func HmacSha1(data, secret []byte) string
- func HmacSha256(data, secret []byte) string
- func HmacSha512(data, secret []byte) string
- func MD5(data []byte) []byte
- func MD5For16Hex(data []byte) string
- func MD5Hex(data []byte) string
- func RSAAddBlockType(src, blockType string) string
- func RSAFormat(src string, buffer *bytes.Buffer)
- func RSAPKCS1Decrypt(private, data []byte) ([]byte, error)
- func RSAPKCS1Generate(bits int, privateHeaders, publicHeaders map[string]string) (private, public []byte, err error)
- func RSAPKCS1SegmentDecrypt(private, data []byte) ([]byte, error)
- func RSAPKCS1Signature(hash crypto.Hash, private, data []byte) ([]byte, error)
- func RSAPKCS1v15Encrypt(public, data []byte) ([]byte, error)
- func RSAPKCS1v15SegmentEncrypt(secret, data []byte) ([]byte, error)
- func RSAPKCS1v15Signature(hash crypto.Hash, private *rsa.PrivateKey, data []byte) ([]byte, error)
- func RSAPKCS1v15Verify(hash crypto.Hash, public, data, sign []byte) error
- func RSAPKCS8Decrypt(private, data []byte) ([]byte, error)
- func RSAPKCS8Generate(bits int, privateHeaders, publicHeaders map[string]string) (private, public []byte, err error)
- func RSAPKCS8SegmentDecrypt(public, data []byte) ([]byte, error)
- func RSAPKCS8Signature(hash crypto.Hash, private, data []byte) ([]byte, error)
- func RSAParsePKCS1PrivateKey(private []byte) (*rsa.PrivateKey, error)
- func RSAParsePKCS8PrivateKey(private []byte) (*rsa.PrivateKey, error)
- func RSAParsePKIXPublicKey(public []byte) (*rsa.PublicKey, error)
- func Sha1(data []byte) []byte
- func Sha1Hex(data []byte) string
- func Sha256(data []byte) []byte
- func Sha256Hex(data []byte) string
- func Sha512(data []byte) []byte
- func Sha512Hex(data []byte) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InvalidECDSAPublicKey = errors.New("invalid ecdsa public key") InvalidECDSAPrivateKey = errors.New("invalid ecdsa private key") ECDSAVerifyFailed = errors.New("ecdsa ecdsa verify failed") )
View Source
var ( InvalidRSAPublicKey = errors.New("invalid rsa public key") InvalidRSAPrivateKey = errors.New("invalid rsa private key") )
Functions ¶
func AesCFBDecrypt ¶
func AesCFBEncrypt ¶
func Base64Decrypt ¶
func Base64Encrypt ¶
func ECDSAGenerate ¶
func ECDSAParsePrivateKey ¶
func ECDSAParsePrivateKey(secret []byte) (*ecdsa.PrivateKey, error)
func ECDSASignature ¶
func MD5For16Hex ¶
func RSAPKCS1Decrypt ¶
func RSAPKCS1Generate ¶
func RSAPKCS1SegmentDecrypt ¶
私钥分段解密
func RSAPKCS1Signature ¶
func RSAPKCS1v15Encrypt ¶
func RSAPKCS1v15SegmentEncrypt ¶
公钥分段加密
func RSAPKCS1v15Signature ¶
func RSAPKCS8Decrypt ¶
func RSAPKCS8Generate ¶
func RSAPKCS8SegmentDecrypt ¶
私钥分段解密
func RSAPKCS8Signature ¶
func RSAParsePKCS1PrivateKey ¶
func RSAParsePKCS1PrivateKey(private []byte) (*rsa.PrivateKey, error)
func RSAParsePKCS8PrivateKey ¶
func RSAParsePKCS8PrivateKey(private []byte) (*rsa.PrivateKey, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.