keys.put("DH_public", new X509EncodedKeySpec(DH_public));
keys.put("DH_private", new PKCS8EncodedKeySpec(DH_private));
keys.put("DSA_public", new X509EncodedKeySpec(DSA_public));
keys.put("DSA_private", new PKCS8EncodedKeySpec(DSA_private));
keys.put("RSA_public", new X509EncodedKeySpec(RSA_public));
keys.put("RSA_private", new PKCS8EncodedKeySpec(RSA_private));
KeyFactory factory = KeyFactory.getInstance(algorithmName);
return factory.generatePrivate(keys.get(algorithmName + "_private"));