github.com/jasoet/gopki@v1.15.0/compatibility/signing/README.md (about)

     1  # Signing Compatibility Tests
     2  
     3  OpenSSL compatibility tests for GoPKI digital signature operations, ensuring 100% interoperability between GoPKI and OpenSSL.
     4  
     5  ## Quick Start
     6  
     7  ### Run Signing Compatibility Tests
     8  
     9  ```bash
    10  # Using Taskfile (recommended)
    11  task test:compatibility:signing
    12  
    13  # Direct Go command
    14  go test -tags=compatibility ./compatibility/signing -v
    15  
    16  # Run all compatibility tests
    17  go test -tags=compatibility ./compatibility/... -v
    18  ```
    19  
    20  ## Test Coverage
    21  
    22  ### ✅ **Algorithms Tested**
    23  - **RSA**: 2048, 3072, 4096-bit signatures
    24  - **ECDSA**: P-256, P-384, P-521 curves
    25  - **Ed25519**: Modern high-performance signatures
    26  
    27  ### ✅ **Signature Formats**
    28  - **Raw Signatures**: Algorithm-specific binary signatures
    29  - **PKCS#7 Attached**: Signature with embedded data
    30  - **PKCS#7 Detached**: Signature separate from data
    31  - **Certificate Chain**: Multi-level certificate inclusion
    32  
    33  ### ✅ **Bidirectional Testing**
    34  - GoPKI signs → OpenSSL verifies
    35  - OpenSSL signs → GoPKI verifies
    36  - Cross-platform signature validation
    37  - Format interoperability verification
    38  
    39  ## Requirements
    40  
    41  - **OpenSSL 3.0+** (compatible with 1.1.1)
    42  - **Go 1.21+** with module support
    43  - **testify** assertion library
    44  
    45  ## Sample Output
    46  
    47  ```
    48  🔐 Running OpenSSL Signing Compatibility Tests...
    49  === RUN   TestSigningCompatibility/RSA/RSA_2048/Raw_Signature_Compatibility/GoPKI_Sign_OpenSSL_Verify
    50      → Creating raw RSA signature with OpenSSL...
    51      ✓ Success: generated 256 bytes of output
    52      ✓ GoPKI RSA signature verified by OpenSSL
    53  === RUN   TestSigningCompatibility/RSA/RSA_2048/PKCS7_Signature_Compatibility/GoPKI_PKCS7_OpenSSL_Verify
    54      → Creating PKCS#7 signature with OpenSSL (detached: false)...
    55      ✓ Success: generated 1024 bytes of output
    56      ✓ GoPKI RSA PKCS#7 signature verified by OpenSSL
    57  --- PASS: TestSigningCompatibility/RSA (0.45s)
    58  ✅ OpenSSL signing compatibility tests completed
    59  ```
    60  
    61  ## Features
    62  
    63  - **Enhanced Logging**: Every OpenSSL command execution is logged
    64  - **Automatic Cleanup**: Temporary files are properly managed
    65  - **Cross-Platform**: Works with OpenSSL 3.x, 1.1.1, LibreSSL
    66  - **Security Validation**: Ensures cryptographic correctness
    67  - **Build Tags**: Conditional testing with `//go:build compatibility`
    68  
    69  ## Documentation
    70  
    71  - **[Complete Documentation](./doc.md)**: Comprehensive signing compatibility guide
    72  - **[Main Compatibility README](../README.md)**: Overview of all compatibility tests
    73  - **[Implementation Details](./doc.md#test-implementation)**: Architecture and usage examples
    74  
    75  ## Troubleshooting
    76  
    77  **OpenSSL Not Found:**
    78  ```bash
    79  which openssl
    80  openssl version
    81  ```
    82  
    83  **Test Failures:**
    84  - Check OpenSSL version compatibility
    85  - Verify temporary directory permissions
    86  - Enable verbose logging with `-v` flag
    87  - Check [troubleshooting guide](./doc.md#troubleshooting)
    88  
    89  This framework ensures GoPKI maintains **100% compatibility** with OpenSSL for all digital signature operations and formats.