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
impl Default for RingCrypto
Source§fn default() -> RingCrypto
fn default() -> RingCrypto
Returns the “default value” for a type. Read more
Source§impl RTCCrypto for RingCrypto
impl RTCCrypto for RingCrypto
Source§fn supports(&self, algorithm: CryptoAlgorithm) -> bool
fn supports(&self, algorithm: CryptoAlgorithm) -> bool
Reports whether an operation is implemented.
Source§fn hash(
&self,
algorithm: HashAlgorithm,
data: &[u8],
) -> Result<Vec<u8>, CryptoError>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fn verify_signature( &self, scheme: SignatureScheme, public_key: PublicKey<'_>, message: &[u8], signature: &[u8], ) -> Result<(), CryptoError>
Verifies a signature.
Auto Trait Implementations§
impl Freeze for RingCrypto
impl RefUnwindSafe for RingCrypto
impl Send for RingCrypto
impl Sync for RingCrypto
impl Unpin for RingCrypto
impl UnsafeUnpin for RingCrypto
impl UnwindSafe for RingCrypto
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more