title: FileNotFound Exception. Keystore File location
body: <p>The Program is giving a <code>FileNotFoundException</code>. I am trying to find it but couldn't solve it.</p>
  
  <p>The exception is:</p>
  
  <pre><code>java.io.FileNotFoundException: src\abckeystore (The system cannot find the path specified)
      at java.io.FileInputStream.open0(Native Method)
      at java.io.FileInputStream.open(Unknown Source)
      at java.io.FileInputStream.&lt;init&gt;(Unknown Source)
      at java.io.FileInputStream.&lt;init&gt;(Unknown Source)
      at packdigit.DigiCert.writing(DigiCert.java:131)
  </code></pre>
  
  <p>The code looks as follows:</p>
  
  <pre><code>public class DigiCert { 
  
      public static final String KEYSTORE = "src/abckeystore";
      public static final char[] PASSWORD = "abc".toCharArray();
      public static final String SRC = "resources/stw.pdf";
      public static final String DEST = "resources/s1new.pdf";
      public static final String DEST1 ="resources/s2new.pdf";
  
  
      public void writing() throws GeneralSecurityException, IOException, DocumentException 
      {
          BouncyCastleProvider provider = new BouncyCastleProvider();
          Security.addProvider(provider); 
          KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
  
           //This statement is showing file Not found error..
          ks.load(new FileInputStream(KEYSTORE), PASSWORD);
          String alias = (String)ks.aliases().nextElement();
  
          PrivateKey pk = (PrivateKey) ks.getKey(alias, PASSWORD);
          Certificate[] chain = ks.getCertificateChain(alias);
          DigiCert app = new DigiCert();
          app.sign(SRC, DEST, chain, pk, DigestAlgorithms.SHA256,provider.getName(), CryptoStandard.CMS,"First Signature", "Delhi",PdfSignatureAppearance.CERTIFIED_NO_CHANGES_ALLOWED);
          app.signAgain(DEST, DEST1, chain, pk, DigestAlgorithms.SHA256,provider.getName(), CryptoStandard.CMS, "Second Signature", "Delhi");
  
      }
  </code></pre>
  
  <p>The File Location is</p>
  
  <pre><code>Src
     packdigit(package)
       DigiCert.java (class)
     abckeystore
  </code></pre>