Struct ethers::signers::yubihsm::asymmetric::PublicKey [−][src]
Expand description
Response from command::get_public_key
Fields
algorithm: Algorithm
Algorithm of the public key
bytes: Vec<u8, Global>
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.
Implementations
Unwrap inner byte vector
Get slice of the inner byte vector
pub fn ecdsa<C>(&self) -> Option<EncodedPoint<C>> where
C: Curve + CurveAlgorithm + PointCompression,
<<<C as Curve>::UInt as ArrayEncoding>::ByteSize as Add<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>>::Output: Add<UInt<UTerm, B1>>,
<<<C as Curve>::UInt as ArrayEncoding>::ByteSize as Add<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>>::Output: ArrayLength<u8>,
<<<<C as Curve>::UInt as ArrayEncoding>::ByteSize as Add<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
pub fn ecdsa<C>(&self) -> Option<EncodedPoint<C>> where
C: Curve + CurveAlgorithm + PointCompression,
<<<C as Curve>::UInt as ArrayEncoding>::ByteSize as Add<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>>::Output: Add<UInt<UTerm, B1>>,
<<<C as Curve>::UInt as ArrayEncoding>::ByteSize as Add<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>>::Output: ArrayLength<u8>,
<<<<C as Curve>::UInt as ArrayEncoding>::ByteSize as Add<<<C as Curve>::UInt as ArrayEncoding>::ByteSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
Return the ECDSA public key of the given curve type if applicable
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<PublicKey, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<PublicKey, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
pub fn as_slice_of<T>(&self) -> Result<&[T], Error> where
T: FromByteSlice,
pub fn base32_len(&self) -> usize
pub fn base32_len(&self) -> usize
Calculate the base32 serialized length
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn write_base32<W>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
pub fn write_base32<W>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more