stella CLI — Regional Cryptographic Compliance Guide
The Stella Ops CLI supports regional cryptographic algorithms so that signing and verification operations meet national and international cryptographic standards. This guide covers the compliance requirements, providers, algorithms, and configuration for each supported region:
- eIDAS — European Union
- SM — China
Audience: operators and compliance owners deploying Stella Ops in a regulated jurisdiction.
Important: each regional provider ships in its own CLI distribution. See the Distribution Matrix for the builds.
eIDAS (European Union)
Overview
eIDAS (electronic IDentification, Authentication and trust Services) is the EU regulation (No 910/2014) governing electronic signatures, seals, and trust services across EU member states.
Applicable Jurisdictions: All 27 EU member states + EEA (Norway, Iceland, Liechtenstein)
Legal Basis:
- Regulation (EU) No 910/2014 (eIDAS Regulation)
- ETSI standards for implementation
- National laws implementing eIDAS
Signature Levels
| Level | Name | Description | Recommended Use |
|---|---|---|---|
| QES | Qualified Electronic Signature | Equivalent to handwritten signature | Contracts, legal documents |
| AES | Advanced Electronic Signature | High assurance, not qualified | Internal approvals, workflows |
| AdES | Advanced Electronic Signature | Basic electronic signature | General document signing |
Crypto Providers
The stella-eu distribution includes eIDAS-compliant providers:
1. TSP Client (Remote Qualified Signature)
Provider: Trust Service Provider remote signing client Certification: Depends on TSP (must be EU-qualified) License: Subscription-based (per TSP)
Configuration:
StellaOps:
Crypto:
Providers:
Eidas:
TspClient:
Enabled: true
TspUrl: "https://tsp.example.eu/api/v1/sign"
ApiKey: "${EIDAS_TSP_API_KEY}"
CertificateId: "qes-cert-2024"
Usage:
# Sign with QES (Qualified Electronic Signature)
stella crypto sign \
--provider eidas \
--algorithm ECDSA-P256-QES \
--key-id qes-cert-2024 \
--file contract.pdf \
--output contract.pdf.sig
2. Local Signer (Advanced Signature)
Provider: Local signing with software keys Certification: Not qualified (AES/AdES only) License: Open source
Configuration:
StellaOps:
Crypto:
Providers:
Eidas:
LocalSigner:
Enabled: true
KeyStorePath: "/etc/stellaops/eidas-keys"
Standards
| Standard | Name | Purpose |
|---|---|---|
| ETSI EN 319 412 | Certificate Profiles | Requirements for certificates (QES, AES) |
| ETSI EN 319 102 | Signature Policies | Signature policy requirements |
| ETSI EN 319 142 | PAdES (PDF Signatures) | PDF Advanced Electronic Signatures |
| ETSI TS 119 432 | Remote Signing | Remote signature creation protocols |
| ETSI EN 319 401 | Trust Service Providers | TSP requirements and policies |
Algorithms
| Algorithm | Description | Signature Level | Recommended |
|---|---|---|---|
ECDSA-P256-QES | ECDSA with P-256 curve (QES) | QES | ✅ Yes |
ECDSA-P384-QES | ECDSA with P-384 curve (QES) | QES | ✅ Yes |
RSA-2048-QES | RSA 2048-bit (QES) | QES | ⚠️ Use ECDSA |
ECDSA-P256-AES | ECDSA with P-256 curve (AES) | AES | ✅ Yes |
Recommendation: Use ECDSA P-256 or P-384 for new implementations. RSA is supported but ECDSA is preferred.
Configuration Example
# appsettings.eidas.yaml
StellaOps:
Backend:
BaseUrl: "https://api.stellaops.eu"
Crypto:
DefaultProvider: "eidas"
Profiles:
- name: "eidas-qes"
provider: "eidas"
algorithm: "ECDSA-P256-QES"
keyId: "qes-cert-2024"
- name: "eidas-aes"
provider: "eidas"
algorithm: "ECDSA-P256-AES"
keyId: "aes-cert-2024"
Providers:
Eidas:
TspClient:
Enabled: true
TspUrl: "https://tsp.example.eu/api/v1/sign"
ApiKey: "${EIDAS_TSP_API_KEY}"
# Qualified Trust Service Provider
TspProfile:
Name: "Example Trust Services Provider"
QualifiedStatus: true
Country: "DE"
TrustedListUrl: "https://tsp.example.eu/tsl.xml"
Keys:
- KeyId: "qes-cert-2024"
Algorithm: "ECDSA-P256-QES"
Source: "tsp"
SignatureLevel: "QES"
FriendlyName: "Qualified Electronic Signature 2024"
- KeyId: "aes-cert-2024"
Algorithm: "ECDSA-P256-AES"
Source: "local"
SignatureLevel: "AES"
FriendlyName: "Advanced Electronic Signature 2024"
EU Trusted List Validation
Verify TSP is on the EU Trusted List:
# Download EU Trusted List
wget https://ec.europa.eu/tools/lotl/eu-lotl.xml
# Validate TSP certificate against trusted list
stella crypto verify-tsp \
--tsp-cert tsp-certificate.pem \
--trusted-list eu-lotl.xml
Official EU Trusted List:
Compliance Checklist
For QES (Qualified Electronic Signature):
- [ ] Use EU-qualified Trust Service Provider (on EU Trusted List)
- [ ] Verify TSP certificate is qualified according to ETSI EN 319 412-2
- [ ] Use signature policy compliant with ETSI EN 319 102-1
- [ ] Include qualified certificate in signature
- [ ] Use qualified signature creation device (QSCD) for key storage
- [ ] Validate against EU Trusted List before accepting signatures
- [ ] Maintain signature validation for 30+ years (long-term validation)
For AES (Advanced Electronic Signature):
- [ ] Uniquely linked to signatory
- [ ] Capable of identifying signatory
- [ ] Created using secure signature creation data
- [ ] Linked to signed data to detect alterations
Legal Considerations
Cross-border Recognition:
- QES has same legal effect as handwritten signature in all EU member states
- AES/AdES may have varying legal recognition across member states
Long-term Validation:
- QES must remain verifiable for decades
- Use AdES with long-term validation (LTV) attributes
- Timestamp signatures to prove time of signing
Data Protection (GDPR):
- eIDAS signatures may contain personal data
- Comply with GDPR when processing signature certificates
- Obtain consent for processing qualified certificate data
SM (China)
Overview
SM (ShāngMì, 商密, Commercial Cipher) refers to China’s national cryptographic algorithms mandated by OSCCA (Office of State Commercial Cryptography Administration).
Applicable Jurisdiction: People’s Republic of China
Legal Basis:
- Cryptography Law of PRC (2020)
- GM/T standards published by OSCCA
- MLPS 2.0 (Multi-Level Protection Scheme 2.0)
SM Standards
| Standard | Name | Purpose |
|---|---|---|
| GM/T 0003-2012 (SM2) | Public Key Cryptographic Algorithm | Elliptic curve signatures and encryption (256-bit) |
| GM/T 0004-2012 (SM3) | Cryptographic Hash Algorithm | Hash function (256-bit output) |
| GM/T 0002-2012 (SM4) | Block Cipher Algorithm | Symmetric encryption (128-bit key) |
| GM/T 0009-2012 (SM9) | Identity-Based Cryptography | Identity-based encryption and signatures |
Crypto Providers
The stella-china distribution includes SM providers:
1. GmSSL (Open Source)
Provider: GmSSL library Certification: Not OSCCA-certified (development/testing only) License: Apache 2.0
Installation:
# Install GmSSL
sudo apt install gmssl
# Verify installation
gmssl version
Configuration:
StellaOps:
Crypto:
Providers:
Sm:
GmSsl:
Enabled: true
LibraryPath: "/usr/lib/libgmssl.so"
2. Commercial CSP (OSCCA-certified)
Provider: OSCCA-certified commercial CSP Certification: OSCCA-certified (required for production) License: Commercial (vendor-specific)
Configuration:
StellaOps:
Crypto:
Providers:
Sm:
CommercialCsp:
Enabled: true
VendorId: "vendor-name"
DeviceId: "device-serial"
Algorithms
| Algorithm | Description | GM Standard | Key Size | Recommended |
|---|---|---|---|---|
SM2 | Elliptic curve signature and encryption | GM/T 0003-2012 | 256-bit | ✅ Yes |
SM3 | Cryptographic hash | GM/T 0004-2012 | 256-bit output | ✅ Yes |
SM4 | Block cipher | GM/T 0002-2012 | 128-bit key | ✅ Yes |
SM9 | Identity-based crypto | GM/T 0009-2012 | 256-bit | ⚠️ Specialized |
Configuration Example
# appsettings.sm.yaml
StellaOps:
Backend:
BaseUrl: "https://api.stellaops.cn"
Crypto:
DefaultProvider: "sm"
Profiles:
- name: "sm-prod-signing"
provider: "sm"
algorithm: "SM2"
keyId: "sm-prod-key-2024"
Providers:
Sm:
GmSsl:
Enabled: true
LibraryPath: "/usr/lib/libgmssl.so"
Keys:
- KeyId: "sm-prod-key-2024"
Algorithm: "SM2"
Source: "file"
FilePath: "/etc/stellaops/keys/sm-key.pem"
FriendlyName: "Production SM2 Signing Key 2024"
Usage Example
# Sign with SM2
stella crypto sign \
--provider sm \
--algorithm SM2 \
--key-id sm-prod-key-2024 \
--file document.pdf \
--output document.pdf.sig
# Verify SM2 signature
stella crypto verify \
--provider sm \
--algorithm SM2 \
--key-id sm-prod-key-2024 \
--file document.pdf \
--signature document.pdf.sig
Test Vectors (OSCCA Compliance)
Verify your SM implementation with official test vectors:
# Test vector from GM/T 0004-2012 (SM3 hash)
echo -n "abc" | gmssl sm3
# Expected output:
# 66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0
Official Test Vectors:
Compliance Checklist
- [ ] Use OSCCA-certified cryptographic product for production
- [ ] Use SM2 for digital signatures (not RSA/ECDSA)
- [ ] Use SM3 for hashing (not SHA-256)
- [ ] Use SM4 for symmetric encryption (not AES)
- [ ] Obtain commercial cipher product model certificate
- [ ] Register commercial cipher use with local authorities (MLPS 2.0)
- [ ] Store keys in OSCCA-certified hardware for sensitive applications
Legal Considerations
Export Control:
- SM implementations are subject to Chinese export control laws
- Distribution outside China may require special permissions
MLPS 2.0 Requirements:
- Level 2+: SM algorithms recommended
- Level 3+: SM algorithms mandatory
- Level 4+: SM algorithms + OSCCA-certified hardware mandatory
Commercial Cipher Regulations:
- Commercial use requires OSCCA product certification
- Open-source implementations (GmSSL) for development/testing only
- Production systems must use OSCCA-certified CSPs
Distribution Selection
| Your Location | Required Compliance | Distribution |
|---|---|---|
| EU Member State | eIDAS QES (legal documents) | stella-eu |
| China | SM2/SM3/SM4 (MLPS 2.0 Level 3+) | stella-china |
| Other | None (international standards) | stella-international |
See also
- CLI Overview — installation and quick start.
- CLI Architecture — plugin architecture.
- Crypto Commands —
stella cryptocommand usage. - Crypto Plugin Development — develop custom providers.
- Distribution Matrix — build and distribution guide.
- Troubleshooting — common compliance issues.
