checkPublicKeyMatch
public static boolean checkPublicKeyMatch(java.security.PublicKey pk1,
java.security.PublicKey pk2)
A method to compare public keys. This is useful for checking if the public key from a
P10 request matches the public key returned from the CA in the response. In the case
of EC keys, there are 3 possible formats for the parameters (specified, named and implicitCA). If the byte encoded match is not identical
then check if it is an ECPublicKey and verify the public point (w) and domains match.
- Parameters:
pk1 - the first public key for the comparisonpk2 - the second public key for the comparison
- Returns:
- true if the public keys match, false if they do not match