public static PrivateKey getPrivateKey(String algo)
throws InvalidKeySpecException, NoSuchAlgorithmException {
KeyFactory kf = KeyFactory.getInstance(algo);
KeySpec kspec;
if (algo.equalsIgnoreCase("DSA")) {
kspec = new DSAPrivateKeySpec
(new BigInteger(DSA_X), new BigInteger(DSA_P),
new BigInteger(DSA_Q), new BigInteger(DSA_G));
} else if (algo.equalsIgnoreCase("RSA")) {
kspec = new RSAPrivateKeySpec
(new BigInteger(RSA_MOD), new BigInteger(RSA_PRIV));