How to encode an ECDSA PublicKey on Java Card so that after I can decode it on another platform (e.g. sending the encoded key in a response APDU and processing it in a standard Java application)? keyPair.getPublic().getEncoded()
on Java would do the trick with PKCS#8 encoding, but as far as I know getEncoded()
is not available on the Java Card platform.
You can implement this function like this:
Card side:
Standard java application side: