code: def load_signing_key(signing_key, crypto_backend=default_backend()):
      
      if not isinstance(crypto_backend, (Backend, MultiBackend)):
          raise ValueError('backend must be a valid Backend object')
  
      if isinstance(signing_key, EllipticCurvePrivateKey):
          return signing_key
      elif isinstance(signing_key, (str, unicode)):
          invalid_strings = [b'-----BEGIN PUBLIC KEY-----']
          invalid_string_matches = [
              string_value in signing_key
              for string_value in invalid_strings
          ]
          if any(invalid_string_matches):
              raise ValueError(
                  'Signing key must be a private key, not a public key.')
  
          try:
              return load_der_private_key(
                  signing_key, password=None, backend=crypto_backend)
          except:
              try:
                  return load_pem_private_key(
                      signing_key, password=None, backend=crypto_backend)
              except Exception:
                  raise ValueError(
                      'Signing key must be a valid private key PEM or DER.')
      else:
          raise ValueError('Signing key must be in string or unicode format.')
docs: Optional: crypto backend object from the "cryptography" python library