I need to extract the private key password, how do I make?
<p>I need to extract the private key of the registered password, how do I make my code is as follows:</p>

<pre><code>public PrivateKey getKeyFromFile(byte privateKeyFile[], char password[])
    throws AssinaException
{
    PrivateKey pk = null;
    Security.addProvider(new BouncyCastleProvider());
    try
    {
        java.io.Reader fRd = new InputStreamReader(new ByteArrayInputStream(privateKeyFile));
        PasswordFinder pGet = new Password(password);
        PEMReader pemRd = new PEMReader(fRd, pGet, "BC");
        KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());

        Object o = pemRd.readObject();

        if(o instanceof KeyPair)
        {
            KeyPair pair = (KeyPair)o;
            pk = (RSAPrivateKey)pair.getPrivate();
        }
    }
    catch(FileNotFoundException ex)
    {
        ex.printStackTrace();
        throw new AssinaException(ex.toString(), ex);
    }
    catch(IOException ex)
    {
        ex.printStackTrace();
        throw new AssinaException(ex.toString(), ex);
    }
    catch(Exception ex)
    {
        ex.printStackTrace();
        throw new AssinaException(ex.toString(), ex);
    }
    return pk;
}
</code></pre>
