Documentation ¶
Index ¶
- Constants
- Variables
- func AesCBCDecode(bs, key, iv []byte) (res []byte, e error)
- func AesCBCEncode(content, key, iv []byte) (res []byte, e error)
- func AesDecode(s string, key string) (result string)
- func AesDecodeBs2Bs(originBytes []byte, keyBytes []byte) (resultBytes []byte)
- func AesDecodeBs2BsWithIV(originBytes, keyBytes, ivBytes []byte) (resultBytes []byte)
- func AesDecodeForBytes(s string, keyBytes []byte) (resultBytes []byte)
- func AesEncode(s string, key string) (result string)
- func AesEncodeBs2Bs(content []byte, key []byte) (result []byte)
- func AesEncodeBs2BsWithIV(content, key, iv []byte) (result []byte)
- func Base64Decode(s string) ([]byte, error)
- func DecodeToBytes(s string) []byte
- func EncodeToString(s []byte) string
- func GenerateRSAKeys() (pubKeyBytes, priKeyBytes []byte, pubKey *rsa.PublicKey, priKey *rsa.PrivateKey, ...)
- func GenerateRSAKeysPKCS1() (pubKeyBytes, priKeyBytes []byte, pubKey *rsa.PublicKey, priKey *rsa.PrivateKey, ...)
- func GenerateRSAKeysPKCS8() (pubKeyBytes, priKeyBytes []byte, pubKey *rsa.PublicKey, priKey *rsa.PrivateKey, ...)
- func MD5(bs []byte) []byte
- func MD5IO(reader io.Reader) []byte
- func MarshalPKCS1PrivateKey(key *rsa.PrivateKey) (priKeyBytes []byte)
- func MarshalPKCS8PrivateKey(key *rsa.PrivateKey) (priKeyBytes []byte, e error)
- func PKCS5Padding(cipherText []byte, blockSize int) []byte
- func PKCS5UnPadding(bs []byte) []byte
- func ParseRSAPublicKey(fromPubKeyBytes []byte) (pubKey *rsa.PublicKey, err error)
- func RSADecode(txt []byte, key *rsa.PrivateKey) (originTxt []byte, err error)
- func RSAEncode(originTxt []byte, key *rsa.PublicKey) (txt []byte, err error)
- func RSASign(originTxt []byte, priKey *rsa.PrivateKey) (signature []byte, err error)
- func RSAVerify(originTxt, signature []byte, pubKey *rsa.PublicKey) error
- func RestoreRSAKeys(fromPriKeyBytes []byte) (pubKeyBytes []byte, pubKey *rsa.PublicKey, priKey *rsa.PrivateKey, err error)
- func SHA1(bs []byte) []byte
- func SHA1IO(reader io.Reader) []byte
Constants ¶
View Source
const Base64Table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Variables ¶
View Source
var Base64Coder = base64.NewEncoding(Base64Table)
Functions ¶
func AesCBCDecode ¶
func AesCBCEncode ¶
func AesDecodeBs2Bs ¶
func AesDecodeBs2BsWithIV ¶
func AesDecodeForBytes ¶
func AesEncodeBs2Bs ¶
func AesEncodeBs2BsWithIV ¶
func Base64Decode ¶
func DecodeToBytes ¶
func GenerateRSAKeys ¶
func GenerateRSAKeysPKCS1 ¶
func GenerateRSAKeysPKCS8 ¶
func MarshalPKCS1PrivateKey ¶
func MarshalPKCS1PrivateKey(key *rsa.PrivateKey) (priKeyBytes []byte)
func MarshalPKCS8PrivateKey ¶
func MarshalPKCS8PrivateKey(key *rsa.PrivateKey) (priKeyBytes []byte, e error)
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func ParseRSAPublicKey ¶
func RestoreRSAKeys ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.