pub struct IronCryptConfig {
pub standard: CryptoStandard,
pub symmetric_algorithm: SymmetricAlgorithm,
pub asymmetric_algorithm: AsymmetricAlgorithm,
pub rsa_key_size: u32,
pub buffer_size: usize,
pub argon2_memory_cost: u32,
pub argon2_time_cost: u32,
pub argon2_parallelism: u32,
pub password_criteria: PasswordCriteria,
pub secrets: Option<SecretsConfig>,
pub data_type_config: Option<DataTypeConfig>,
pub audit: Option<AuditConfig>,
}Expand description
Main configuration for an IronCrypt instance.
This struct allows for detailed customization of the security parameters used for encryption, key generation, and password hashing.
§Examples
Creating a custom configuration:
use ironcrypt::config::{IronCryptConfig, PasswordCriteria};
use ironcrypt::standards::CryptoStandard;
let custom_config = IronCryptConfig {
standard: CryptoStandard::Custom,
symmetric_algorithm: ironcrypt::algorithms::SymmetricAlgorithm::ChaCha20Poly1305,
asymmetric_algorithm: ironcrypt::algorithms::AsymmetricAlgorithm::Ecc,
rsa_key_size: 4096,
buffer_size: 8192,
argon2_memory_cost: 32768, // 32MB
argon2_time_cost: 4,
argon2_parallelism: 2,
password_criteria: PasswordCriteria {
min_length: 10,
..Default::default()
},
secrets: None,
data_type_config: None,
audit: None,
};Fields§
§standard: CryptoStandardThe cryptographic standard to use.
This determines the set of algorithms and key sizes. If set to Custom,
the symmetric_algorithm, asymmetric_algorithm, and rsa_key_size fields
must be specified manually.
symmetric_algorithm: SymmetricAlgorithmThe symmetric algorithm to use for data encryption.
Note: This is ignored if standard is not Custom.
asymmetric_algorithm: AsymmetricAlgorithmThe asymmetric algorithm to use for key encapsulation.
Note: This is ignored if standard is not Custom.
rsa_key_size: u32The size of the RSA key in bits.
Note: This is ignored if standard is not Custom.
buffer_size: usizeThe size of the buffer to use for streaming operations (in bytes).
argon2_memory_cost: u32The memory cost (in KiB) for the Argon2 password hashing algorithm.
argon2_time_cost: u32The time cost (or number of iterations) for the Argon2 algorithm.
argon2_parallelism: u32The parallelism factor (or number of threads) for the Argon2 algorithm.
password_criteria: PasswordCriteriaThe criteria used to validate password strength.
secrets: Option<SecretsConfig>Configuration for the secret management backend.
data_type_config: Option<DataTypeConfig>Configuration for data type specific key management.
audit: Option<AuditConfig>Configuration for auditing.
Implementations§
Source§impl IronCryptConfig
impl IronCryptConfig
Sourcepub fn from_file(path: &str) -> Result<Self, ConfigError>
pub fn from_file(path: &str) -> Result<Self, ConfigError>
Loads configuration from a TOML file.
Trait Implementations§
Source§impl Clone for IronCryptConfig
impl Clone for IronCryptConfig
Source§fn clone(&self) -> IronCryptConfig
fn clone(&self) -> IronCryptConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more