Skip to main content

RingCrypto

Struct RingCrypto 

Source
pub struct RingCrypto;
Expand description

Ring-backed cryptographic operations, with documented RustCrypto fallbacks for primitives Ring does not expose (MD5, AES block/CTR/CBC, and AES-CCM).

Trait Implementations§

Source§

impl Default for RingCrypto

Source§

fn default() -> RingCrypto

Returns the “default value” for a type. Read more
Source§

impl RTCCrypto for RingCrypto

Source§

fn supports(&self, algorithm: CryptoAlgorithm) -> bool

Reports whether an operation is implemented.
Source§

fn hash( &self, algorithm: HashAlgorithm, data: &[u8], ) -> Result<Vec<u8>, CryptoError>

Hashes data.
Source§

fn new_hmac( &self, algorithm: HmacAlgorithm, key: &[u8], ) -> Result<Box<dyn Mac>, CryptoError>

Creates a keyed MAC. Read more
Source§

fn block_encrypt( &self, algorithm: BlockCipherAlgorithm, key: &[u8], block: &mut [u8], ) -> Result<(), CryptoError>

Encrypts exactly one block in place.
Source§

fn new_stream_cipher( &self, algorithm: StreamCipherAlgorithm, key: &[u8], ) -> Result<Box<dyn StreamCipher>, CryptoError>

Creates a keyed stream cipher.
Source§

fn new_aead( &self, algorithm: AeadAlgorithm, key: &[u8], ) -> Result<Box<dyn AeadCipher>, CryptoError>

Creates a keyed AEAD cipher.
Source§

fn new_cbc( &self, algorithm: CbcAlgorithm, key: &[u8], ) -> Result<Box<dyn CbcCipher>, CryptoError>

Creates a keyed CBC cipher.
Source§

fn start_key_exchange( &self, algorithm: KeyExchangeAlgorithm, ) -> Result<Box<dyn ActiveKeyExchange>, CryptoError>

Starts a one-shot ephemeral key exchange.
Source§

fn generate_signing_key( &self, scheme: SignatureScheme, ) -> Result<Arc<dyn SigningKey>, CryptoError>

Generates an exportable signing key.
Source§

fn import_signing_key( &self, scheme: SignatureScheme, pkcs8_der: &[u8], ) -> Result<Arc<dyn SigningKey>, CryptoError>

Imports an exportable PKCS#8 signing key.
Source§

fn verify_signature( &self, scheme: SignatureScheme, public_key: PublicKey<'_>, message: &[u8], signature: &[u8], ) -> Result<(), CryptoError>

Verifies a signature.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.