Documentation ¶
Index ¶
- func ExportRsaPublicKeyAsPemStr(pubkey *rsa.PublicKey) (string, error)
- func FormatPemStr(s, headerLine, footerLine string) string
- func FormatToAlipay(pem string) string
- func GenerateRsaKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, []byte, []byte, error)
- func IsValidateRsaKeyPair(publicKey, privateKey string) (bool, error)
- func IsValidateRsaPrivateKeyStr(s string) (bool, error)
- func IsValidateRsaPublicKeyStr(s string) (bool, error)
- func ParseCertFromPemBase64Str(certPEM string) (*x509.Certificate, error)
- func ParseCertFromPemStr(certPEM string) (*x509.Certificate, error)
- func ParseCertFromPemStrBytes(certBytes []byte) (*x509.Certificate, error)
- func ParseRsaPrivateKeyFromPemBase64Str(privateKeyPEM string) (*rsa.PrivateKey, error)
- func ParseRsaPrivateKeyFromPemStr(privateKeyPEM string) (*rsa.PrivateKey, error)
- func ParseRsaPrivateKeyFromPemStrBytes(privBytes []byte) (*rsa.PrivateKey, error)
- func ParseRsaPublicKeyFromPemBase64Str(publicKeyPEM string) (*rsa.PublicKey, error)
- func ParseRsaPublicKeyFromPemStr(publicKeyPEM string) (*rsa.PublicKey, error)
- func ParseRsaPublicKeyFromPemStrBytes(publicKeyBytes []byte) (*rsa.PublicKey, error)
- func PrivateDecrypt(ciphertext string, privateKeyPem string) (string, error)
- func PrivateEncrypt(data string, privt string) (string, error)
- func PrivateKeyFormat(s string) string
- func PrivateSign(data string, priv *rsa.PrivateKey) (string, error)
- func PublicDecrypt(ciphertext string, pub string) (string, error)
- func PublicEncrypt(data string, publicKeyPemStr string) (string, error)
- func PublicKeyFormat(s string) string
- func PublicVerify(data string, sign string, pub *rsa.PublicKey) error
- func SplitSubN(s string, n int) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatPemStr ¶
func FormatToAlipay ¶
func GenerateRsaKeyPair ¶
GenerateRsaKeyPair generate key pair
func IsValidateRsaKeyPair ¶
IsValidateRsaKeyPair 验证一对rsa密钥是否是合法的
func IsValidateRsaPrivateKeyStr ¶
IsValidateRsaPrivateKeyStr 验证RSA死私钥字符串是否合法
func IsValidateRsaPublicKeyStr ¶
IsValidateRsaPublicKeyStr 验证RSA公钥字符串是否合法
func ParseCertFromPemBase64Str ¶
func ParseCertFromPemBase64Str(certPEM string) (*x509.Certificate, error)
func ParseCertFromPemStr ¶
func ParseCertFromPemStr(certPEM string) (*x509.Certificate, error)
func ParseCertFromPemStrBytes ¶
func ParseCertFromPemStrBytes(certBytes []byte) (*x509.Certificate, error)
func ParseRsaPrivateKeyFromPemBase64Str ¶
func ParseRsaPrivateKeyFromPemBase64Str(privateKeyPEM string) (*rsa.PrivateKey, error)
func ParseRsaPrivateKeyFromPemStr ¶
func ParseRsaPrivateKeyFromPemStr(privateKeyPEM string) (*rsa.PrivateKey, error)
func ParseRsaPrivateKeyFromPemStrBytes ¶
func ParseRsaPrivateKeyFromPemStrBytes(privBytes []byte) (*rsa.PrivateKey, error)
func PrivateDecrypt ¶
PrivateDecrypt 私钥解密
func PrivateEncrypt ¶
PrivateEncrypt 私钥加密
func PrivateKeyFormat ¶
func PrivateSign ¶
func PrivateSign(data string, priv *rsa.PrivateKey) (string, error)
PrivateSign 签名
func PublicDecrypt ¶
PublicDecrypt 公钥解密
func PublicEncrypt ¶
PublicEncrypt 公钥加密
func PublicKeyFormat ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.