code: func (mgr *SigningManager) Sign(object []byte, key core.Key) ([]byte, error) {
  
  	if len(object) == 0 {
  		return nil, errors.New("object (to sign) required")
  	}
  
  	if key == nil {
  		return nil, errors.New("key (for signing) required")
  	}
  
  	digest, err := mgr.cryptoProvider.Hash(object, mgr.hashOpts)
  	if err != nil {
  		return nil, err
  	}
  	signature, err := mgr.cryptoProvider.Sign(key, digest, mgr.signerOpts)
  	if err != nil {
  		return nil, err
  	}
  	return signature, nil
  }
docs: // Sign will sign the given object using provided key