That does look like a different key. Please try again as you've probably send an old key or something. Make sure you don't regenerate the key pair, it will be different each time. Use the private key to print out the modulus as BigInteger
instead; BigInteger
instances will always print out as decimals making for an easier comparison. Or even better, use BigInteger.toString(16)
to get a hexadecimal representation.
If you use a good random number generator (like the default one in Java) then the modulus should be unique for the key pair. Therefore it, or the SHA1 hash over the modulus is normally used to identify the key.