func (k *rsaPublicKey) Verify(data io.Reader, alg string, signature []byte) error {
	sigAlg, err := rsaSignatureAlgorithmByName(alg)
	if err != nil {
		return fmt.Errorf("unable to verify Signature: %s", err)
	}
	hasher := sigAlg.HashID().New()
	_, err = io.Copy(hasher, data)
	if err != nil {
		return fmt.Errorf("error reading data to sign: %s", err)
	}
	hash := hasher.Sum(nil)
	err = rsa.VerifyPKCS1v15(k.PublicKey, sigAlg.HashID(), hash, signature)
	if err != nil {
		return fmt.Errorf("invalid %s signature: %s", sigAlg.HeaderParam(), err)
	}
	return nil
}
Verify verifyies the signature of the data in the io.Reader using this Public Key.
The alg parameter should be the name of the JWA digital signature algorithm
which was used to produce the signature and should be supported by this
public key. Returns a nil error if the signature is valid.
package libtrust
import (
	"crypto"
	"crypto/rand"
	"crypto/rsa"
	"crypto/x509"
	"encoding/json"
	"encoding/pem"
	"errors"
	"fmt"
	"io"
	"math/big"
)
type rsaPublicKey struct {
	*rsa.PublicKey
	extended map[string]interface{}
}
func fromRSAPublicKey(cryptoPublicKey *rsa.PublicKey) *rsaPublicKey {
	return &rsaPublicKey{cryptoPublicKey, map[string]interface{}{}}
}
func (k *rsaPublicKey) KeyType() string {
	return "RSA"
}
func (k *rsaPublicKey) KeyID() string {
	return keyIDFromCryptoKey(k)
}
func (k *rsaPublicKey) String() string {
	return fmt.Sprintf("RSA Public Key <%s>", k.KeyID())
}