Skip to main content

Module digest

Module digest 

Source
Expand description

Message digests used for certificate thumbprints.

Windows uses the native CNG hash providers (BCrypt). Elsewhere rustls uses standalone RustCrypto hash implementations (independent of its TLS crypto provider); OpenSSL-only builds use OpenSSL.

TargetBackend
rustls, non-Windowssha1 / sha2
OpenSSL only, non-WindowsOpenSSL (tls_openssl::sha)
windowsCNG (BCryptHashData)

SHA-1 is provided only because the public API accepts 40 hex character thumbprints (allowedThumbprints) which are SHA-1 digests of the DER certificate. The public sha1() function is meant for identification only. Supporting SHA-1 thumbprints does not enable SHA-1 certificate signatures; their acceptance follows the trust backend’s policy (see crate::x509::trust).

Enums§

Algorithm
Digest algorithm used for certificate thumbprints.

Constants§

SHA1_LEN
Size of a SHA-1 digest in bytes.
SHA256_LEN
Size of a SHA-256 digest in bytes.

Functions§

sha1
Computes the SHA-1 digest of data.
sha256
Computes the SHA-256 digest of data.