peat_protocol/security/
mod.rs1mod callsign;
40mod device_id;
41mod encryption;
42mod error;
43mod formation_key;
44mod keypair;
45
46mod audit;
48mod auth_state;
49mod authenticator;
50mod authorization;
51mod membership;
52mod transport;
53mod user_auth;
54
55pub use peat_mesh::security::{
58 CallsignError,
60 CallsignGenerator,
61 DeviceId,
63 DeviceKeypair,
64 EncryptedCellMessage,
66 EncryptedData,
67 EncryptedDocument,
68 EncryptionKeypair,
69 EncryptionManager,
70 FormationAuthResult,
72 FormationChallenge,
73 FormationChallengeResponse,
74 FormationKey,
75 GroupKey,
76 SecureChannel,
77 SecurityError,
78 SymmetricKey,
79 CHALLENGE_NONCE_SIZE,
81 DEFAULT_CHALLENGE_TIMEOUT_SECS,
82 FORMATION_CHALLENGE_SIZE,
84 FORMATION_RESPONSE_SIZE,
85 MAX_CALLSIGN_LENGTH,
87 NATO_ALPHABET,
88 NONCE_SIZE,
90 PUBLIC_KEY_SIZE,
91 SIGNATURE_SIZE,
92 SYMMETRIC_KEY_SIZE,
93 TOTAL_CALLSIGNS,
94 X25519_PUBLIC_KEY_SIZE,
95};
96
97pub use audit::{
100 AuditEventType, AuditLogEntry, AuditLogger, FileAuditLogger, MemoryAuditLogger,
101 NullAuditLogger, SecurityViolation,
102};
103pub use authenticator::{DeviceAuthenticator, VerifiedPeer};
104pub use authorization::{
105 AuthenticatedEntity, AuthorizationContext, AuthorizationController, AuthorizationPolicy,
106 CellMembershipContext, DeviceIdentityInfo, DeviceType, HierarchyLevel, Permission, Role,
107 UserIdentityInfo,
108};
109pub use transport::{AuthenticatedConnection, AuthenticationChannel, SecureMeshTransport};
110pub use user_auth::{
111 AccountStatus, AuthMethod, Credential, LocalUserStore, MilitaryRank, OrganizationUnit,
112 SecurityClearance, SessionId, UserAuthenticator, UserIdentity, UserIdentityBuilder, UserRecord,
113 UserSession, UserStore,
114};
115
116pub use membership::{
118 CertificateRegistry, MemberPermissions, MembershipCertificate, CERTIFICATE_BASE_SIZE,
119 MAX_CALLSIGN_LEN, MESH_ID_LEN,
120};
121
122pub use auth_state::{
124 AuthConfig, AuthStateEvent, AuthStateMonitor, AuthStateTracker, CertificateState,
125};
126
127pub use peat_schema::security::v1::{
129 Challenge, DeviceIdentity, DeviceType as ProtoDeviceType,
130 HierarchyLevel as ProtoHierarchyLevel, SecurityError as ProtoSecurityError, SignedBeacon,
131 SignedChallengeResponse,
132};
133
134impl From<peat_mesh::security::SecurityError> for crate::Error {
136 fn from(err: peat_mesh::security::SecurityError) -> Self {
137 crate::Error::Security(err.to_string())
138 }
139}
140
141#[cfg(test)]
142mod tests {
143 use super::*;
144
145 #[test]
146 fn test_module_exports() {
147 let _: fn() -> DeviceKeypair = DeviceKeypair::generate;
149 }
150}