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§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_header_mask(
&self,
algorithm: HeaderMaskAlgorithm,
key: &[u8],
) -> Result<Box<dyn HeaderMask>, CryptoError>
fn new_header_mask( &self, algorithm: HeaderMaskAlgorithm, key: &[u8], ) -> Result<Box<dyn HeaderMask>, CryptoError>
Creates a keyed record-number mask generator (RFC 9147 section 4.2.3).
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.
Source§fn key_exchange_respond(
&self,
algorithm: KeyExchangeAlgorithm,
peer_share: &[u8],
) -> Result<(Vec<u8>, SecretVec), CryptoError>
fn key_exchange_respond( &self, algorithm: KeyExchangeAlgorithm, peer_share: &[u8], ) -> Result<(Vec<u8>, SecretVec), CryptoError>
Answers a key exchange the peer started: makes this side’s share for
peer_share
and the shared secret. For the Diffie-Hellman groups that is a key pair and an
agreement, which is what the default does; a KEM-based group (X25519MLKEM768)
encapsulates to the peer’s key instead, and its provider overrides this.Auto Trait Implementations§
impl Forget for RingCrypto
impl Freeze for RingCrypto
impl Move 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