[−][src]Struct yubihsm::asymmetric::PublicKey
Response from command::get_public_key
Fields
algorithm: Algorithm
Algorithm of the public key
bytes: Vec<u8>
The public key in raw bytes. Keys have the following structure:
- RSA: Public modulus N (0x100 | 0x200 | 0x400 bytes)
- ECC (non-Ed25519):
- Public point X (0x20 | 0x30 | 0x40 | 0x42 bytes)
- Public point Y (0x20 | 0x30 | 0x40 | 0x42 bytes)
- Ed25519: Public point A, compressed (0x20 bytes)
In particular note that in the case of e.g. ECDSA public keys, many libraries will expect a 0x04 (DER OCTET STRING) tag byte at the beginning of the key. The YubiHSM does not return this, so you may need to add it depending on your particular application.
Methods
impl PublicKey
[src]
pub fn into_vec(self) -> Vec<u8>
[src]
Unwrap inner byte vector
pub fn len(&self) -> usize
[src]
Get length of the key
pub fn as_slice(&self) -> &[u8]
[src]
Get slice of the inner byte vector
Trait Implementations
impl PartialEq<PublicKey> for PublicKey
[src]
impl AsRef<[u8]> for PublicKey
[src]
impl Clone for PublicKey
[src]
fn clone(&self) -> PublicKey
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Into<Vec<u8>> for PublicKey
[src]
impl Eq for PublicKey
[src]
impl Debug for PublicKey
[src]
impl Serialize for PublicKey
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for PublicKey
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,