Skip to main content

bitwarden_pam_sealed/
lib.rs

1#![doc = include_str!("../README.md")]
2
3bitwarden_commercial_marker::commercial_crate!();
4
5mod policy;
6mod rotation_config;
7mod target_system;
8#[cfg(test)]
9mod test_support;
10
11use bitwarden_crypto::{EncString, safe::DataEnvelope};
12pub use policy::{
13    GENERATOR_MAX_LENGTH, GENERATOR_MIN_LENGTH, PasswordPolicyError, SealedPasswordPolicy,
14};
15pub use rotation_config::{RotationConfigSealedV1, seal_rotation_config, unseal_rotation_config};
16pub use target_system::{
17    SealedTargetSystemKind, SealedTargetSystemMethod, TargetSystemSealedV1, seal_target_system,
18    unseal_target_system,
19};
20
21/// Output of sealing. The server stores the two halves as separate fields so org-key rotation only
22/// re-wraps `wrapped_key`.
23#[derive(Debug, Clone)]
24pub struct Sealed {
25    /// Sent as `sealedData`.
26    pub envelope: DataEnvelope,
27    /// Sent as `wrappedKey`.
28    pub wrapped_key: EncString,
29}