Hi
I want to retrieve a public key from HKP Server (4 different) but not working properly
I´m using the Trial Java Library + JRE 1.6
This is my code (also try without HKPClient parameters... only server without Port and/or https connection.. with same results):
try
{
boolean useHttps = false;
HKPClient hkp = new HKPClient("pgp.mit.edu", 80, useHttps);
//HKPClient hkp = new HKPClient("hkps.pool.sks-keyservers.net", 80, useHttps);
//HKPClient hkp = new HKPClient("pgp.rediris.es", 11371, useHttps);
//HKPClient hkp = new HKPClient("pgp.zdv.uni-mainz.de", 11371, useHttps);
hkp.setPartialMatchUserIds(true);
byte[] keyBytes = hkp.getKeyByUserId("Julio Cesar Arellano");
if (keyBytes != null && keyBytes.length > 0)
{
String keyInAscii = new String(keyBytes, "ASCII");
System.out.println("key found");
System.out.println(keyInAscii);
}
else
{
System.out.println("no key found");
}
}
catch (IOException e)
{
System.out.println("ERROR: " + e.getMessage());
}
}
But ... if I do the same test with the C# library (Visual Studio 2013 + NET 3.5) works perfect in all cases.
Please help =D
Daniel