old_contents: from cryptography.hazmat.backends import default_backend
  from cryptography.hazmat.primitives.asymmetric import rsa
  from cryptography.hazmat.primitives import serialization
  
  
  def get_new_rsa_private_key_in_pem_format():
      """ returns a new rsa key in pem format. """
      private_key = rsa.generate_private_key(
          key_size=2048, backend=default_backend(), public_exponent=65537)
      return private_key.private_bytes(
          encoding=serialization.Encoding.PEM,
          format=serialization.PrivateFormat.TraditionalOpenSSL,
          encryption_algorithm=serialization.NoEncryption()
      )
  
  
  def get_public_key_pem_for_private_key_pem(private_key_pem):
      private_key = serialization.load_pem_private_key(
          private_key_pem,
          password=None,
          backend=default_backend()
      )
      public_key = private_key.public_key()
      return public_key.public_bytes(
          encoding=serialization.Encoding.PEM,
          format=serialization.PublicFormat.SubjectPublicKeyInfo
      )
  
new_contents: from cryptography.hazmat.backends import default_backend
  from cryptography.hazmat.primitives.asymmetric import rsa
  from cryptography.hazmat.primitives import serialization
  
  from ..signer import JWTAuthSigner
  
  
  def get_new_rsa_private_key_in_pem_format():
      """ returns a new rsa key in pem format. """
      private_key = rsa.generate_private_key(
          key_size=2048, backend=default_backend(), public_exponent=65537)
      return private_key.private_bytes(
          encoding=serialization.Encoding.PEM,
          format=serialization.PrivateFormat.TraditionalOpenSSL,
          encryption_algorithm=serialization.NoEncryption()
      )
  
  
  def get_public_key_pem_for_private_key_pem(private_key_pem):
      private_key = serialization.load_pem_private_key(
          private_key_pem,
          password=None,
          backend=default_backend()
      )
      public_key = private_key.public_key()
      return public_key.public_bytes(
          encoding=serialization.Encoding.PEM,
          format=serialization.PublicFormat.SubjectPublicKeyInfo
      )
  
  
  def get_example_jwt_auth_signer(**kwargs):
      """ returns an example jwt_auth_signer instance. """
      issuer = kwargs.get('issuer', 'egissuer')
      key_id = kwargs.get('key_id', '%s/a' % issuer)
      key = kwargs.get('key', get_new_rsa_private_key_in_pem_format())
      return JWTAuthSigner(issuer, key_id, key)
  
subject: Add get_example_jwt_auth_signer to tests/utils.