Struct ssb_common::keys::PublicKey [] [src]

pub struct PublicKey(_);

An ssb public key. This type abstracts over the fact that ssb can support multiple cryptographic primitives.

Methods

impl PublicKey
[src]

[src]

Return the length (in bytes) of the key.

[src]

Verify the given signed message with this PublicKey. On success, return a Vec<u8> containing the message without the signature.

[src]

Verify the given message with this PublicKey and the given Signature.

Panics

Panics if this PublicKey and the Signature use different cryptographic primitives.

[src]

Verify the given message with this PublicKey and the given Signature. Return None if this PublicKey and the Signature use different cryptographic primitives.

[src]

Return whether this PublicKey uses the ed25519 cryptographic primitive.

[src]

Return whether this PublicKey uses a cryptographic primitive that is currently considered secure.

The return value of this method may change as new versions of this module are released.

[src]

Return whether this PublicKey uses the same cryptographic primitive as the given SecretKey.

[src]

Return whether this PublicKey uses the same cryptographic primitive as the given Signature.

[src]

Create a PublicKey from a PublicKeyEnc.

Prefer to directly use the FromStr impl.

Trait Implementations

impl Copy for PublicKey
[src]

impl Clone for PublicKey
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for PublicKey
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for PublicKey
[src]

impl PartialOrd for PublicKey
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for PublicKey
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl Hash for PublicKey
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for PublicKey
[src]

[src]

Formats the value using the given formatter.

impl From<PublicKey> for PublicKey
[src]

[src]

Performs the conversion.

impl TryInto<PublicKey> for PublicKey
[src]

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

Fails if the underlying cryptographic primitive is not ed25519.

[src]

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

Performs the conversion.

impl AsRef<[u8]> for PublicKey
[src]

[src]

Performs the conversion.

impl Index<Range<usize>> for PublicKey
[src]

Allows to access the byte contents of a PublicKey as a slice.

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl Index<RangeTo<usize>> for PublicKey
[src]

Allows to access the byte contents of a PublicKey as a slice.

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl Index<RangeFrom<usize>> for PublicKey
[src]

Allows to access the byte contents of a PublicKey as a slice.

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl Index<RangeFull> for PublicKey
[src]

Allows to access the byte contents of a PublicKey as a slice.

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl From<PublicKeyEncBuf> for PublicKey
[src]

[src]

Performs the conversion.

impl FromStr for PublicKey
[src]

This can be used to parse an encoded PublicKey.

Fails if the given string does not contain an encoding of a PublicKey.

[src]

Parses a string s to return a value of this type. Read more