1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! Assembly identity and cryptographic verification for .NET assemblies.
//!
//! This module provides comprehensive identity management for .NET assemblies,
//! supporting both cryptographic verification and multi-assembly identification.
//! It serves as the foundation for cross-assembly resolution, dependency tracking,
//! and multi-assembly project management.
//!
//! # ECMA-335 References
//!
//! This module implements identity concepts defined in the ECMA-335 specification:
//! - **Section II.6.3**: Referencing assemblies - defines assembly reference format
//! - **Section II.22.2**: Assembly table - defines assembly metadata structure
//! - **Section II.22.5**: AssemblyRef table - defines assembly reference structure
//! - **Section II.6.2.1.3**: PublicKeyToken - defines public key token computation
//!
//! See: <https://ecma-international.org/publications-and-standards/standards/ecma-335/>
//!
//! # Module Structure
//!
//! - `assembly` - Complete assembly identity with name, version, culture, and strong name
//! - `cryptographic` - Cryptographic identity and verification (public keys and tokens)
//!
//! # Key Components
//!
//! ## Assembly Identity
//! - [`AssemblyIdentity`](crate::metadata::identity::AssemblyIdentity) - Complete assembly identification for multi-assembly scenarios
//! - [`AssemblyVersion`](crate::metadata::identity::AssemblyVersion) - Four-part version numbering with parsing and comparison
//! - [`ProcessorArchitecture`](crate::metadata::identity::ProcessorArchitecture) - Processor architecture specification
//!
//! ## Cryptographic Identity
//! - [`Identity`](crate::metadata::identity::Identity) - Public key and token-based cryptographic identity
//! - Strong name verification and token generation
//! - Support for MD5, SHA1, and custom hash algorithms
//!
//! # Usage Examples
//!
//! ## Assembly Identity Management
//!
//! ```rust,no_run
//! use dotscope::metadata::identity::{AssemblyIdentity, AssemblyVersion};
//!
//! // Create assembly identity
//! let identity = AssemblyIdentity::new(
//! "MyLibrary",
//! AssemblyVersion::new(1, 0, 0, 0),
//! None, // culture-neutral
//! None, // no strong name
//! None, // architecture-neutral
//! );
//!
//! // Parse from display name
//! let mscorlib = AssemblyIdentity::parse(
//! "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
//! )?;
//! # Ok::<(), dotscope::Error>(())
//! ```
//!
//! ## Cryptographic Verification
//!
//! ```rust,no_run
//! use dotscope::metadata::identity::Identity;
//! use dotscope::metadata::tables::AssemblyHashAlgorithm;
//!
//! // Create identity from public key
//! let pubkey_data = vec![0x30, 0x82, 0x01, 0x0A]; // RSA public key
//! let identity = Identity::from(&pubkey_data, true)?;
//!
//! // Generate public key token
//! let token = identity.to_token(AssemblyHashAlgorithm::SHA1)?;
//! println!("Public key token: 0x{:016X}", token);
//! # Ok::<(), dotscope::Error>(())
//! ```
//!
//! ## Integration with Metadata
//!
//! ```rust,ignore
//! use dotscope::metadata::identity::AssemblyIdentity;
//! use dotscope::metadata::tables::AssemblyRef;
//!
//! // Extract identity from metadata
//! let assembly_ref: AssemblyRef = // ... loaded from metadata
//! let identity = AssemblyIdentity::from_assembly_ref(&assembly_ref);
//!
//! // Use in dependency tracking
//! let dependency_graph = AssemblyDependencyGraph::new();
//! dependency_graph.add_dependency(source_identity, target_identity);
//! # Ok::<(), dotscope::Error>(())
//! ```
//!
//! # Integration with CilProject
//!
//! This identity system provides the foundation for:
//! - **Multi-assembly containers** in CilProject
//! - **Cross-assembly type resolution** in GlobalTypeResolver
//! - **Dependency tracking and analysis** in AssemblyDependencyGraph
//! - **Version binding and compatibility** analysis
//! - **Assembly loading and management** strategies
//!
//! # Thread Safety
//!
//! All types in this module are thread-safe and can be safely shared across
//! threads. Assembly identities serve as keys in concurrent collections and
//! participate in lock-free data structures throughout the system.
pub use ;
pub use Identity;