pub struct Md(/* private fields */);
Expand description
A message digest algorithm.
Implementations§
Source§impl Md
impl Md
Sourcepub fn from_nid(type_: Nid) -> Option<&'static MdRef>
pub fn from_nid(type_: Nid) -> Option<&'static MdRef>
Returns the Md
corresponding to an Nid
.
This corresponds to EVP_get_digestbynid
.
Sourcepub fn fetch(
ctx: Option<&LibCtxRef>,
algorithm: &str,
properties: Option<&str>,
) -> Result<Self, ErrorStack>
pub fn fetch( ctx: Option<&LibCtxRef>, algorithm: &str, properties: Option<&str>, ) -> Result<Self, ErrorStack>
Fetches an Md
object corresponding to the specified algorithm name and properties.
Requires OpenSSL 3.0.0 or newer.
This corresponds to EVP_MD_fetch
.
pub fn null() -> &'static MdRef
pub fn md5() -> &'static MdRef
pub fn sha1() -> &'static MdRef
pub fn sha224() -> &'static MdRef
pub fn sha256() -> &'static MdRef
pub fn sha384() -> &'static MdRef
pub fn sha512() -> &'static MdRef
pub fn sha3_224() -> &'static MdRef
pub fn sha3_256() -> &'static MdRef
pub fn sha3_384() -> &'static MdRef
pub fn sha3_512() -> &'static MdRef
pub fn shake128() -> &'static MdRef
pub fn shake256() -> &'static MdRef
pub fn ripemd160() -> &'static MdRef
pub fn sm3() -> &'static MdRef
Methods from Deref<Target = MdRef>§
Sourcepub fn block_size(&self) -> usize
pub fn block_size(&self) -> usize
Returns the block size of the digest in bytes.
This corresponds to EVP_MD_block_size
.
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Returns the size of the digest in bytes.
This corresponds to EVP_MD_size
.
Sourcepub fn type_(&self) -> Nid
pub fn type_(&self) -> Nid
Returns the Nid
of the digest.
This corresponds to EVP_MD_type
.
Trait Implementations§
Source§impl ForeignType for Md
impl ForeignType for Md
impl Send for Md
impl Sync for Md
Auto Trait Implementations§
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes