rsa.go
func (rs *RSASigner) SignBytes(buf []byte) ([]byte, error) {
	var err error

	// check rs.priv
	if rs.priv == nil {
		return nil, ErrMissingPrivateKey
	}

	// hash
	h := rs.hash.New()
	_, err = h.Write(buf)
	if err != nil {
		return nil, err
	}

	// sign
	return rs.method.Sign(rand.Reader, rs.priv, rs.hash, h.Sum(nil))
}
func (rs *RSASigner) SignBytes(buf []byte) ([]byte, error) {
	var err error

	// check rs.priv
	if rs.priv == nil {
		return nil, ErrMissingPrivateKey
	}

	// hash
	h := rs.hash.New()
	_, err = h.Write(buf)
	if err != nil {
		return nil, err
	}

	// sign
	return rs.method.Sign(rand.Reader, rs.priv, rs.hash, h.Sum(nil))
}
func ( rs * RSASigner ) SignBytes ( buf [ ] byte ) ( [ ] byte , error ) { var err error // check rs.priv if rs . priv == nil { return nil , ErrMissingPrivateKey } // hash h := rs . hash . New ( ) _ , err = h . Write ( buf ) if err != nil { return nil , err } // sign return rs . method . Sign ( rand . Reader , rs . priv , rs . hash , h . Sum ( nil ) ) }
// SignBytes creates a signature for buf.
SignBytes creates a signature for buf .