xwt-cert-utils 0.1.0

Useful utils for working with certificates, provided by and for xwt. Not directly required to use xwt, but can be helpful. Also usable without xwt. Inteded to work with both wasm and native.
Documentation
1
2
3
4
5
6
7
8
9
//! Digest computation.

/// Compute a SHA256 digest for the given data.
///
/// Pass DER certificate here to compute its digest.
#[cfg(feature = "digest-sha256")]
pub fn sha256(data: &[u8]) -> ring::digest::Digest {
    ring::digest::digest(&ring::digest::SHA256, data)
}