input: Write a function to generate an RSA public/private key pair and save them in .pem files named 'public.pem' and 'private.pem'. If the key generation is successful, return True. If there is an issue during the key generation process, return False. If the input is invalid, return None.
  assert generate_key_pair()==True
  assert invalid_input()==None
  assert failed_generation()==False
output: from cryptography.hazmat.primitives.asymmetric import rsa
  from cryptography.hazmat.primitives import serialization
  
  def generate_key_pair():
      try:
          private_key = rsa.generate_private_key(
              public_exponent=65537,
              key_size=2048
          )
          public_key = private_key.public_key()
  
          with open("private.pem", "wb") as f:
              f.write(private_key.private_bytes(
                  encoding=serialization.Encoding.PEM,
                  format=serialization.PrivateFormat.PKCS8,
                  encryption_algorithm=serialization.NoEncryption()
              ))
  
          with open("public.pem", "wb") as f:
              f.write(public_key.public_bytes(
                  encoding=serialization.Encoding.PEM,
                  format=serialization.PublicFormat.SubjectPublicKeyInfo
              ))
  
          return True
      except Exception as e:
          return False