Documentation ¶
Index ¶
- Variables
- func LowerSafeDecrypt(priv *rsa.PrivateKey, msg []byte) ([]byte, error)
- func LowerSafeEncrypt(pub *rsa.PublicKey, msg []byte) ([]byte, error)
- func MarshalXMLPrivateKey(key *rsa.PrivateKey) ([]byte, error)
- func MarshalXMLPublicKey(key *rsa.PublicKey) ([]byte, error)
- func ParseXMLPrivateKey(der []byte) (*rsa.PrivateKey, error)
- func ParseXMLPublicKey(der []byte) (*rsa.PublicKey, error)
- func PrivateKeyBytes(pri *rsa.PrivateKey, in []byte, isEncrytp bool) ([]byte, error)
- func PublicKeyBytes(pub *rsa.PublicKey, in []byte, isEncrytp bool) ([]byte, error)
- type XMLKey
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") )
Functions ¶
func LowerSafeDecrypt ¶ added in v1.0.2053
func LowerSafeDecrypt(priv *rsa.PrivateKey, msg []byte) ([]byte, error)
rsa no padding decrypt
func LowerSafeEncrypt ¶ added in v1.0.2053
rsa no padding encrypt
func MarshalXMLPrivateKey ¶
func MarshalXMLPrivateKey(key *rsa.PrivateKey) ([]byte, error)
func ParseXMLPrivateKey ¶
func ParseXMLPrivateKey(der []byte) (*rsa.PrivateKey, error)
func PrivateKeyBytes ¶ added in v1.0.2054
私钥加密或解密byte
Types ¶
type XMLKey ¶
type XMLKey struct{}
*
- rsa xml密钥 *
- @create 2023-4-10
- @author deatil
func (XMLKey) MarshalPrivateKey ¶
func (this XMLKey) MarshalPrivateKey(key *rsa.PrivateKey) ([]byte, error)
包装私钥
func (XMLKey) MarshalPublicKey ¶
包装公钥
func (XMLKey) ParsePrivateKey ¶
func (this XMLKey) ParsePrivateKey(der []byte) (*rsa.PrivateKey, error)
解析私钥
Click to show internal directories.
Click to hide internal directories.