Documentation ¶
Index ¶
- Constants
- func Decrypt(path string, msg []byte) ([]byte, error)
- func Encrypt(path string, msg []byte) ([]byte, error)
- func GenerateKeyFile(bits int, pkcs PKCS, privateKeyPath, publicKeyPath, certPath string) error
- func ParsePrivateKey(path string) (*rsa.PrivateKey, error)
- func ParsePublicKey(path string) (*rsa.PublicKey, error)
- func Sign(path string, msg []byte) ([]byte, error)
- func SignSHA256(path string, msg []byte) ([]byte, error)
- func Verify(path string, msg, sign []byte) bool
- func VerifySHA256(path string, msg, sign []byte) bool
- type PKCS
Constants ¶
View Source
const ( // PKCS1 = "RSA PRIVATE KEY" // PKCS8 = "PRIVATE KEY" PUBKEY = "PUBLIC KEY" RSAAlgorithmSign = crypto.SHA256 )
Variables ¶
This section is empty.
Functions ¶
func GenerateKeyFile ¶
生成密钥对
func VerifySHA256 ¶ added in v1.0.8
RSA验签 path 公钥匙文件地址 msg 解密的数据 sign 签名的数据
Types ¶
Click to show internal directories.
Click to hide internal directories.