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.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
getEncoded()
method returns the key in its primary encoding format, or null if the key does not support encoding. So you don't need to use it for your goal. you simply can use down-casting toECPublicKey
:The
pubKey
in the above line, is equal with output ofgetEncoded()
method in Java applications.You can implement this function like this:
Card side:
Standard java application side: