2024-03-16 11:22:08 +01:00
|
|
|
|
#[cfg(feature = "encryption")]
|
2024-02-17 17:12:16 +01:00
|
|
|
|
mod canonicalization;
|
2024-02-15 18:47:36 +01:00
|
|
|
|
#[cfg(feature = "encryption")]
|
2024-04-07 11:48:33 +02:00
|
|
|
|
mod coffio;
|
2024-03-17 14:31:01 +01:00
|
|
|
|
#[cfg(feature = "encryption")]
|
|
|
|
|
mod context;
|
2024-03-17 14:45:18 +01:00
|
|
|
|
#[cfg(feature = "encryption")]
|
|
|
|
|
mod encrypted_data;
|
2024-03-02 14:55:14 +01:00
|
|
|
|
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
2024-02-15 10:56:21 +01:00
|
|
|
|
mod error;
|
2024-02-15 18:17:49 +01:00
|
|
|
|
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
2024-02-14 23:11:00 +01:00
|
|
|
|
mod ikm;
|
2024-02-15 23:45:21 +01:00
|
|
|
|
#[cfg(feature = "encryption")]
|
|
|
|
|
mod kdf;
|
2024-02-15 18:17:49 +01:00
|
|
|
|
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
2024-02-15 10:00:06 +01:00
|
|
|
|
mod scheme;
|
2024-03-16 11:22:08 +01:00
|
|
|
|
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
2024-02-17 20:26:45 +01:00
|
|
|
|
mod storage;
|
2024-02-14 18:16:45 +01:00
|
|
|
|
|
2024-02-15 18:47:36 +01:00
|
|
|
|
#[cfg(feature = "encryption")]
|
2024-04-20 18:23:57 +02:00
|
|
|
|
pub use crate::coffio::Coffio;
|
2024-03-17 14:31:01 +01:00
|
|
|
|
#[cfg(feature = "encryption")]
|
|
|
|
|
pub use context::{DataContext, KeyContext};
|
2024-03-02 14:55:14 +01:00
|
|
|
|
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
2024-02-15 10:56:21 +01:00
|
|
|
|
pub use error::Error;
|
2024-02-15 18:17:49 +01:00
|
|
|
|
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
2024-02-25 18:14:13 +01:00
|
|
|
|
pub use ikm::{IkmId, InputKeyMaterial, InputKeyMaterialList};
|
2024-02-15 18:17:49 +01:00
|
|
|
|
#[cfg(any(feature = "encryption", feature = "ikm-management"))]
|
2024-02-15 10:00:06 +01:00
|
|
|
|
pub use scheme::Scheme;
|
2024-02-14 18:16:45 +01:00
|
|
|
|
|
2024-04-20 11:43:53 +02:00
|
|
|
|
/// Default amount of time during which the input key material will be considered valid once it has
|
|
|
|
|
/// been generated. This value is expressed in seconds.
|
2024-03-02 14:55:57 +01:00
|
|
|
|
///
|
2024-04-20 11:43:53 +02:00
|
|
|
|
/// Considering that a day is composed of 86400 seconds (60×60×24) and a year is 365.24219 days
|
|
|
|
|
/// (approximate value of the [mean tropical year][tropical_year]), this value is equivalent to 10
|
|
|
|
|
/// years.
|
2024-03-02 14:55:57 +01:00
|
|
|
|
///
|
|
|
|
|
/// [tropical_year]: https://en.wikipedia.org/wiki/Tropical_year
|
2024-02-15 12:37:14 +01:00
|
|
|
|
#[cfg(feature = "ikm-management")]
|
2024-03-02 14:55:57 +01:00
|
|
|
|
pub const DEFAULT_IKM_DURATION: u64 = 315_569_252;
|
2024-03-09 12:40:28 +01:00
|
|
|
|
/// Default amount of time during which a key is valid.
|
|
|
|
|
/// This is used for automatic periodic key rotation.
|
|
|
|
|
/// This value is expressed in seconds.
|
|
|
|
|
///
|
2024-04-20 11:43:53 +02:00
|
|
|
|
/// Considering that a day is composed of 86400 seconds (60×60×24) and a year is 365.24219 days
|
|
|
|
|
/// (approximate value of the [mean tropical year][tropical_year]), this value is equivalent to 1
|
|
|
|
|
/// year.
|
2024-03-09 12:40:28 +01:00
|
|
|
|
///
|
|
|
|
|
/// [tropical_year]: https://en.wikipedia.org/wiki/Tropical_year
|
|
|
|
|
#[cfg(feature = "encryption")]
|
|
|
|
|
pub const DEFAULT_KEY_CTX_PERIODICITY: u64 = 31_556_925;
|
2024-04-20 11:48:58 +02:00
|
|
|
|
/// Default scheme used when adding a new IKM. The value is `XChaCha20Poly1305WithBlake3` if the
|
|
|
|
|
/// `chacha` feature is enabled, then `Aes128GcmWithSha256` if the `aes` feature is enabled.
|
|
|
|
|
#[cfg(all(feature = "ikm-management", feature = "chacha"))]
|
2024-04-07 22:17:01 +02:00
|
|
|
|
pub const DEFAULT_SCHEME: Scheme = Scheme::XChaCha20Poly1305WithBlake3;
|
2024-04-20 11:48:58 +02:00
|
|
|
|
#[cfg(all(feature = "ikm-management", feature = "aes", not(feature = "chacha")))]
|
|
|
|
|
pub const DEFAULT_SCHEME: Scheme = Scheme::Aes128GcmWithSha256;
|