{
BCPGKey key = publicPk.getKey();
if (publicPk.getVersion() <= 3)
{
RSAPublicBCPGKey rK = (RSAPublicBCPGKey)key;
this.keyID = rK.getModulus().longValue();
try
{
MessageDigest digest = MessageDigest.getInstance("MD5");
byte[] bytes = new MPInteger(rK.getModulus()).getEncoded();
digest.update(bytes, 2, bytes.length - 2);
bytes = new MPInteger(rK.getPublicExponent()).getEncoded();
digest.update(bytes, 2, bytes.length - 2);
this.fingerprint = digest.digest();
}
catch (NoSuchAlgorithmException e)
{
throw new IOException("can't find MD5");
}
this.keyStrength = rK.getModulus().bitLength();
}
else
{
byte[] kBytes = publicPk.getEncodedContents();