Files
proton-sdk-rs/crates/proton-sdk/src/crypto.rs
T
nvrl d72065418b feat(drive,sdk): port upstream C# SDK up to ce000edd
- Moves go through `move-multiple` in batches of 150, with an optional
  target name per node (`move_nodes_streaming` / `NodeMoveItem`), a single
  `InvalidRequirements` retry against the server's current name hash, and
  passphrase signing for anonymously created nodes. A batch rejected as a
  whole keeps its API error code on every node.
- Share memberships carry invite time and inviter email, and the inviter's
  `drive.share-member.inviter` signature is verified as non-fatal metadata
  (`verify_detached_with_context`).
- `Node` gains `direct_role` and `share_id`.
- Trashed detection reads `TrashTime` as well as the legacy `Trashed`.

Breaking: new public struct fields on `Node` and `ShareMembership`.
2026-09-15 13:54:04 +02:00

36 lines
1.3 KiB
Rust

//! PGP cryptography primitives backed by rPGP.
//!
//! Proton's key model is layered: an address key (unlocked from the account
//! passphrase) decrypts a share/node *passphrase*, which in turn unlocks the
//! locked node key, which decrypts names, hash keys and content keys. This
//! module exposes the small set of operations that chain implements.
mod content;
mod derive;
mod encrypt;
mod errors;
mod keys;
mod messages;
mod srp;
mod verify;
pub use content::ContentKey;
pub use derive::derive_key_passphrase;
pub use encrypt::{
GeneratedNodeKey, SHARING_EXTERNAL_INVITATION_CONTEXT, SHARING_INVITER_CONTEXT,
SHARING_MEMBER_CONTEXT, StandardShareMaterial, VolumeCreationMaterial, accept_invitation,
build_standard_share_material, build_volume_creation_material, encrypt_external_invitation,
encrypt_invitation, generate_node_hash_key, generate_node_key, generate_node_key_aead,
};
pub use errors::CryptoError;
pub use keys::{PrivateKey, decrypt_armored_with_keys};
pub use messages::decrypt_armored_with_password;
pub use srp::{DEFAULT_BIT_LENGTH, SrpProofs, SrpVerifier, generate_proofs, generate_verifier};
pub use verify::{
PublicKey, VerificationKeyRing, VerificationStatus, verify_detached,
verify_detached_with_context,
};
/// Result alias for crypto operations.
pub type CryptoResult<T> = std::result::Result<T, CryptoError>;