code: def sign(self, msg, key):
          
  
          if not isinstance(key, rsa.RSAPrivateKey):
              raise TypeError(
                  "The key must be an instance of rsa.RSAPrivateKey")
          sig = key.sign(msg, self.padding, self.hash)
          return sig
docs: Create a signature over a message as defined in RFC7515 using an
          RSA key
  
          :param msg: the message.
          :type msg: bytes
          :returns: bytes, the signature of data.
          :rtype: bytes