Verify implements the Verify method from SigningMethod. For this signing method, must be an *rsa.PublicKey.
(raw []byte, sig Signature, key interface{})
| 41 | // Verify implements the Verify method from SigningMethod. |
| 42 | // For this signing method, must be an *rsa.PublicKey. |
| 43 | func (m *SigningMethodRSA) Verify(raw []byte, sig Signature, key interface{}) error { |
| 44 | rsaKey, ok := key.(*rsa.PublicKey) |
| 45 | if !ok { |
| 46 | return ErrInvalidKey |
| 47 | } |
| 48 | return rsa.VerifyPKCS1v15(rsaKey, m.Hash, m.sum(raw), sig) |
| 49 | } |
| 50 | |
| 51 | // Sign implements the Sign method from SigningMethod. |
| 52 | // For this signing method, must be an *rsa.PrivateKey structure. |