Documentation ¶
Index ¶
- Variables
- func GetPriKey(prikey []byte) (*rsa.PrivateKey, error)
- func GetPriKeyByPfxFile(strFile string, strPasswd string) (prikey *rsa.PrivateKey, err error)
- func GetPriKeyPfx(pfxKey []byte, strPasswd string) (prikey *rsa.PrivateKey, err error)
- func GetPubKey(pubkey []byte) (*rsa.PublicKey, error)
- func GetPubKeyByCerFile(strFile string) (pubkey *rsa.PublicKey, err error)
- func GetPubKeyCer(cerKey []byte) (pubkey *rsa.PublicKey, err error)
- func ParseCerPublicKey(cerKey []byte) (*rsa.PublicKey, error)
- func PriKeyDecrypt(prikey *rsa.PrivateKey, input []byte) ([]byte, error)
- func PriKeyEncrypt(prikey *rsa.PrivateKey, input []byte) ([]byte, error)
- func PubKeyDecrypt(pubkey *rsa.PublicKey, input []byte) ([]byte, error)
- func PubKeyEncrypt(pubkey *rsa.PublicKey, input []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDataToLarge = errors.New("message too long for RSA public key size") ErrDataLen = errors.New("data length error") ErrDataBroken = errors.New("data broken, first byte is not zero") ErrKeyPairDismatch = errors.New("data is not encrypted by the private key") ErrDecryption = errors.New("decryption error") ErrPublicKey = errors.New("get public key error") ErrPrivateKey = errors.New("get private key error") )
Functions ¶
func GetPriKeyByPfxFile ¶
func GetPriKeyByPfxFile(strFile string, strPasswd string) (prikey *rsa.PrivateKey, err error)
通过指定文件获得证书私钥
func GetPriKeyPfx ¶
func GetPriKeyPfx(pfxKey []byte, strPasswd string) (prikey *rsa.PrivateKey, err error)
通过内存数组获得证书私钥
func GetPubKeyByCerFile ¶
通过指定文件获得证书公钥
func GetPubKeyCer ¶
通过内存数组获得证书公钥
func ParseCerPublicKey ¶
Certificate证书获取公钥对象
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.