rsa

package
v0.0.0-...-f17293a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportRsaPublicKeyAsPemStr

func ExportRsaPublicKeyAsPemStr(pubkey *rsa.PublicKey) (string, error)

func FormatPemStr

func FormatPemStr(s, headerLine, footerLine string) string

func FormatToAlipay

func FormatToAlipay(pem string) string

func GenerateRsaKeyPair

func GenerateRsaKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, []byte, []byte, error)

GenerateRsaKeyPair generate key pair

func IsValidateRsaKeyPair

func IsValidateRsaKeyPair(publicKey, privateKey string) (bool, error)

IsValidateRsaKeyPair 验证一对rsa密钥是否是合法的

func IsValidateRsaPrivateKeyStr

func IsValidateRsaPrivateKeyStr(s string) (bool, error)

IsValidateRsaPrivateKeyStr 验证RSA死私钥字符串是否合法

func IsValidateRsaPublicKeyStr

func IsValidateRsaPublicKeyStr(s string) (bool, error)

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 ParseRsaPublicKeyFromPemBase64Str

func ParseRsaPublicKeyFromPemBase64Str(publicKeyPEM string) (*rsa.PublicKey, error)

func ParseRsaPublicKeyFromPemStr

func ParseRsaPublicKeyFromPemStr(publicKeyPEM string) (*rsa.PublicKey, error)

func ParseRsaPublicKeyFromPemStrBytes

func ParseRsaPublicKeyFromPemStrBytes(publicKeyBytes []byte) (*rsa.PublicKey, error)

func PrivateDecrypt

func PrivateDecrypt(ciphertext string, privateKeyPem string) (string, error)

PrivateDecrypt 私钥解密

func PrivateEncrypt

func PrivateEncrypt(data string, privt string) (string, error)

PrivateEncrypt 私钥加密

func PrivateKeyFormat

func PrivateKeyFormat(s string) string

func PrivateSign

func PrivateSign(data string, priv *rsa.PrivateKey) (string, error)

PrivateSign 签名

func PublicDecrypt

func PublicDecrypt(ciphertext string, pub string) (string, error)

PublicDecrypt 公钥解密

func PublicEncrypt

func PublicEncrypt(data string, publicKeyPemStr string) (string, error)

PublicEncrypt 公钥加密

func PublicKeyFormat

func PublicKeyFormat(s string) string

func PublicVerify

func PublicVerify(data string, sign string, pub *rsa.PublicKey) error

func SplitSubN

func SplitSubN(s string, n int) []string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL