title: KeyPairGenerator cannot be resolved
body: <p>I'm trying to create a little message system using RSA to encrypt the messages, but I'm stuck right in the beginning because for some reason, the code doesn't recognize KeyPairGenerator class.
  My code so far, as following many examples on the Internet, is:</p>
  
  <pre><code>public class RSA {
      private KeyPairGenerator key_par_gen = null;
      private KeyPair kp = null;
      private PublicKey publicKey = null;
      private PrivateKey privateKey = null;
      private KeyFactory factory_rsa = null;
      private RSAPublicKeySpec pub = null;
      private RSAPrivateKeySpec priv = null;
  
      public RSA(){       
          setKey_par_gen(); 
          setKp(); //No error here
      }
  
      public void setKey_par_gen() {
          this.key_par_gen = new KeyPairGenerator.getInstance("RSA");
          //Error: Description    Resource    Path    Location    Type
          //       KeyPairGenerator.getInstance cannot be resolved to a type  RSA.java    /RSA - Cloud/src    line 41 Java Problem
  
      }
  
      public void setKp() {
          this.kp = getKey_par_gen().genKeyPair();
      }
  //....
  }
  </code></pre>
  
  <p>I already updated to the latest java version, opened the KeyPairGenerator declaration and it's there, with the declared function and all.
  Also can't be from the IDE, since I tried on Intellij, Eclipse and Netbeans.
  Don't know what I'm missing here. Any help is appreciated.</p>