Struct safe_crypto::PublicId[][src]

pub struct PublicId { /* fields omitted */ }

Represents a public identity, consisting of a public signature key and a public encryption key.

Methods

impl PublicId
[src]

Returns a public key representing this public identity.

Encrypts serialisable plaintext using anonymous encryption.

Anonymous encryption will use an ephemeral public key, so the recipient won't be able to tell who sent the ciphertext. If you wish to encrypt bytestring plaintext, use encrypt_anonymous_bytes. To use authenticated encryption, use SharedSecretKey.

Returns ciphertext in case of success. Can return an EncryptionError in case of a serialisation error.

Encrypts bytestring plaintext using anonymous encryption.

Anonymous encryption will use an ephemeral public key, so the recipient won't be able to tell who sent the ciphertext. To use authenticated encryption, use SharedSecretKey.

Returns ciphertext in case of success.

Verifies the detached signature.

Returns true if the signature is valid the data is verified.

Trait Implementations

impl Debug for PublicId
[src]

Formats the value using the given formatter. Read more

impl Hash for PublicId
[src]

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

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

impl PartialEq for PublicId
[src]

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

This method tests for !=.

impl Eq for PublicId
[src]

impl PartialOrd for PublicId
[src]

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

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

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

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

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

impl Ord for PublicId
[src]

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Clone for PublicId
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for PublicId

impl Sync for PublicId