Struct ethers::signers::yubihsm::asymmetric::PublicKey[][src]

pub struct PublicKey {
    pub algorithm: Algorithm,
    pub bytes: Vec<u8, Global>,
}
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 length of the key

Get slice of the inner byte vector

Return the ECDSA public key of the given curve type if applicable

Return the Ed25519 public key if applicable

Trait Implementations

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Calculate the base32 serialized length

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Error type if conversion fails

Check if all values are in range and return array-like struct of u5 values

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate. Read more

Convert Self to base32 vector

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca) Read more

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA) Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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