Export zymkey public key to PEM format

Hi,

We are trying to sign payloads using ZK4i as stated here in order to send them to our API. For that, we need to previously export the Zymkey public key and keep it on server side for signature verification.

We are using this function to extract the public key from the zymkey: zymkey.client.get_ecdsa_public_key()

However, we are not able to import the obtained key in our server, since we do not recognize this format (a bytearray that looks like hex). Could you help us with the importation details or the conversion to another format like PEM?

Thanks in advance,
Jose

You could export the public key in PEM format to a file with the following,

zymkey.client.create_public_key_file("/tmp/zk.pem", slot=0)

There are a couple of conditions on the file name, like it has to be an absolute path, you need write permission. You can review here: