title: BouncyCastle in Java
body: <p>I have used the following cod in my program to convert byte to public key </p>
  
  <pre><code>Security.addProvider(new BouncyCastleProvider());
           X509EncodedKeySpec x509keyspec=new X509EncodedKeySpec(b);
  
  
           KeyFactory keyfact=KeyFactory.getInstance("RSA","BC");
           Key pubkey=keyfact.generatePublic(x509keyspec); 
  </code></pre>
  
  <p>I have imported "import org.bouncycastle.jce.provider.BouncyCastleProvider;",. </p>
  
  <p>I have added Bouncycastle.jar file into my jre7/lib/ext folder and made changes in javasecurity file by adding following line <code>security.provider.11=org.bouncycastle.jce.provider.BouncyCastleProvider</code>
  When i compile code i m getting following error </p>
  
  <pre><code>Reverse.java:14: error: cannot find symbol
  import java.security.spec.x509EncodedKeySpecs;
                           ^
  symbol:   class x509EncodedKeySpecs
  location: package java.security.spec
  
  Reverse.java:16: error: package org.bouncycastle.jce.provider does not exist
  import org.bouncycastle.jce.provider.BouncyCastleProvider;
  
  Reverse.java:49: error: cannot find symbol
  Security.addProvider(new BouncyCastleProvider());
                                    ^
    symbol:   class BouncyCastleProvider
    location: class Reverse
  </code></pre>