Documentation ¶
Index ¶
- Constants
- Variables
- func FormatPublicKey(publicKey string) string
- func ParsePublicKey(publicKey string) (*rsa.PublicKey, error)
- func Rsa2PubSign(signContent, sign, publicKey string, hash crypto.Hash) (err error)
- func VerifySign(content, sign string, pubKeys []string) (err error)
- type Sign
- type Signer
- type Verifier
- type Verify
Constants ¶
View Source
const ( // 私钥 PEMBEGIN 开头 PEMBEGIN = "-----BEGIN RSA PRIVATE KEY-----\n" // 私钥 PEMEND 结尾 PEMEND = "\n-----END RSA PRIVATE KEY-----" // 公钥 PEMBEGIN 开头 PUBPEMBEGIN = "-----BEGIN PUBLIC KEY-----\n" // 公钥 PEMEND 结尾 PUBPEMEND = "\n-----END PUBLIC KEY-----" )
Variables ¶
View Source
var ErrPemDecode = errors.New("pem.Decode failed") // pem解析失败
Functions ¶
func ParsePublicKey ¶
ParsePublicKey 公钥验证
func Rsa2PubSign ¶
Rsa2PubSign RSA2公钥验证签名
func VerifySign ¶
Types ¶
type Verifier ¶
type Verifier struct {
V Verify
}
func NewRSA2Verifier ¶
func NewRSA2Verifier() *Verifier
func NewVerifier ¶
Click to show internal directories.
Click to hide internal directories.