This directory contains implementations of crypto primitives for use in Chromium. Most of these are either:
There is very little actual cryptographic code in //crypto - it is mostly wrappers.
This directory is actively being refactored as of 2025-06. See PLAN.md.
Many interfaces in this directory are deprecated and being changed or removed; check the comment at the top of the header file before using them.
vector<uint8_t>
, array<uint8_t>
, and span<uint8_t>
rather than string
and string_view
.keypair::PrivateKey::ToPrivateKeyInfo()
, which returns a PKCS#8 PrivateKeyInfo structure serialized as a byte vector. To unserialize keys in this format, use keypair::PrivateKey::FromPrivateKeyInfo()
.keypair::PublicKey::ToSubjectPublicKeyInfo()
or keypair::PrivateKey::ToSubjectPublicKeyInfo()
, which return a X.509 SubjectPublicKeyInfo structure serialized as a byte vector. To unserialize public keys in this format, use keypair::PublicKey::FromPublicKeyInfo()
.vector<uint8_t>
, array<uint8_t>
, or span<uint8_t>
directly.