Cargo Features

pkcs8 has no features set by default.

[dependencies]
pkcs8 = { version = "0.11.0-rc.1", features = ["std", "alloc", "3des", "des-insecure", "encryption", "getrandom", "pem", "sha1-insecure", "subtle"] }
std = alloc

Enables std of der and spki

Affects traits::DecodePrivateKey.read_pkcs8_der_file, traits::EncodePrivateKey.write_pkcs8_der_file, traits::DecodePrivateKey.read_pkcs8_pem_file, traits::EncodePrivateKey.write_pkcs8_pem_file

alloc encryption? pem? std?

Enables alloc and zeroize of der, alloc of spki

Affects encrypted_private_key_info::EncryptedPrivateKeyInfoOwned, private_key_info::PrivateKeyInfoOwned, traits::EncodePrivateKey

3des = encryption

Enables 3des of pkcs5

des-insecure = encryption

Enables des-insecure of pkcs5

encryption 3des? des-insecure? sha1-insecure? = alloc, rand_core

Enables alloc and pbes2 of pkcs5

Affects traits::DecodePrivateKey.from_pkcs8_encrypted_der, traits::EncodePrivateKey.to_pkcs8_encrypted_der, traits::DecodePrivateKey.from_pkcs8_encrypted_pem, traits::EncodePrivateKey.to_pkcs8_encrypted_pem

getrandom

Enables getrandom of rand_core

optional dependencies

pem = alloc

Enables pem of der and spki

Affects traits::DecodePrivateKey.from_pkcs8_pem, traits::EncodePrivateKey.to_pkcs8_pem, traits::DecodePrivateKey.from_pkcs8_encrypted_pem, traits::DecodePrivateKey.read_pkcs8_pem_file, traits::EncodePrivateKey.to_pkcs8_encrypted_pem, traits::EncodePrivateKey.write_pkcs8_pem_file

sha1-insecure = encryption

Enables sha1-insecure of pkcs5

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

rand_core encryption? getrandom?
pkcs5 3des? des-insecure? encryption? sha1-insecure?
subtle implicit feature

Enables subtle

subtle:

Pure-Rust traits and utilities for constant-time cryptographic implementations