code: func (id *signingidentity) Sign(msg []byte) ([]byte, error) {
  	//mspIdentityLogger.Infof("Signing message")
  
  	// Compute Hash
  	hashOpt, err := id.getHashOpt(id.msp.cryptoConfig.SignatureHashFamily)
  	if err != nil {
  		return nil, errors.WithMessage(err, "failed getting hash function options")
  	}
  
  	digest, err := id.msp.bccsp.Hash(msg, hashOpt)
  	if err != nil {
  		return nil, errors.WithMessage(err, "failed computing digest")
  	}
  
  	if len(msg) < 32 {
  		mspIdentityLogger.Debugf("Sign: plaintext: %X \n", msg)
  	} else {
  		mspIdentityLogger.Debugf("Sign: plaintext: %X...%X \n", msg[0:16], msg[len(msg)-16:])
  	}
  	mspIdentityLogger.Debugf("Sign: digest: %X \n", digest)
  
  	// Sign
  	return id.signer.Sign(rand.Reader, digest, nil)
  }
docs: // Sign produces a signature over msg, signed by this instance