check sign from client
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"crypto"
|
||||
"crypto/rsa"
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
@ -67,3 +68,7 @@ func (p *PublicKey) Verify() bool {
|
||||
}
|
||||
return VerifySignature(encoded, p.Signature)
|
||||
}
|
||||
|
||||
func (p *PublicKey) VerifyMessage(hash, signature []byte) error {
|
||||
return rsa.VerifyPKCS1v15(p.PubKey, crypto.SHA256, hash, signature)
|
||||
}
|
||||
|
Reference in New Issue
Block a user