Documentation ¶
Index ¶
- Variables
- func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)
- func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)
- func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
- func PublicKeyToBytes(pub *rsa.PublicKey) ([]byte, error)
- func SignPKCS1v15(text []byte, priv *rsa.PrivateKey) ([]byte, error)
- func VerifyPKCS1v15(text, signature []byte, pub *rsa.PublicKey) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRsaPemDecode = errors.New("rsa pem decode error") ErrRsaConvert = errors.New("rsa convert not ok") )
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)
func GenerateKeyPair ¶
func PrivateKeyToBytes ¶
func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte
func SignPKCS1v15 ¶
func SignPKCS1v15(text []byte, priv *rsa.PrivateKey) ([]byte, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.