An internal representation of a asymetric Public key.
This trait is useful for managing keys internally in Tock.
PubKey is designed for fixed length keys. That is an implementation should support only a single key length, for example RSA 2048. Note that we don’t use const generics here though. That is because even within a single key length implementation, there can be different length inputs, for examples compressed or uncompressed keys.
Import an existing public key.
The reference to the
public_key is stored internally and can be
retrieved with the
public_key can be either a mutable static or an immutable static,
depending on where the key is stored (flash or memory).
The possible ErrorCodes are:
BUSY: A key is already imported or in the process of being
INVAL: An invalid key was supplied.
SIZE: An invalid key size was supplied.
Return the public key supplied by
On success the return value is
Ok(()) with the buffer that was
originally passed in to hold the key.
On failure the possible ErrorCodes are:
NODEVICE: The key does not exist
Report the length of the public key in bytes, as returned from
A value of 0 indicates that the key does not exist.