How eclipse-keypont/crypto11 works
Crypto11 is a Go library that adapts PKCS#11-backed keys and cryptographic operations to Go’s crypto interfaces. A caller configures a token context, then uses it to locate or create keys and certificates and perform cryptographic operations; symmetric crypto, HMAC, and random generation are additional capabilities. The graph reflects README capabilities and sampled implementation paths. Some internal call relationships are not visible in the excerpts, so those links are omitted rather than inferred.
Main entry points: crypto11.go Token context · sessions.go Session pool · attributes.go Attribute templates · rsa.go RSA
Components 21
Context and sessions
- Token context
crypto11.go - Session pool
sessions.go - Resource pool
internal/pool/resource_pool.go
Keys and attributes
- Attribute templates
attributes.go - Key discovery
keys.go
Asymmetric crypto
- RSA
rsa.go - ECDSA
ecdsa.go - DSA
dsa.go - ML-KEM
mlkem.go - ML-KEM KDF
mlkem_kdf.go
Symmetric crypto
- AEAD
aead.go - Block modes
blockmode.go - Symmetric ciphers
symmetric.go - HMAC
hmac.go
Certificates and utilities
- X.509 certificates
certificates.go - Random reader
rand.go - Crypto helpers
common.go - Key templates
templates.go
Other components
- Go application
- PKCS#11 token
- PKCS#11 bindings
Connections 20
- Go application → Token context: configures
README.md - Token context → PKCS#11 bindings: initializes module
crypto11.go - Session pool → Resource pool: uses
sessions.go - Session pool → PKCS#11 bindings: opens sessions
sessions.go - Go application → RSA: generates, signs
README.md - Go application → ECDSA: generates, signs
README.md - Go application → DSA: generates, signs
README.md - Go application → ML-KEM: encapsulates, decapsulates
README.md - Go application → Symmetric ciphers: uses cipher
README.md - Go application → Block modes: uses modes
README.md - Go application → AEAD: uses AEAD
README.md - Go application → HMAC: uses HMAC
README.md - Go application → X.509 certificates: imports, retrieves
README.md - Go application → Random reader: reads randomness
README.md - Go application → Key discovery: finds keys
keys.go - RSA → Attribute templates: builds templates
rsa.go - ML-KEM → Attribute templates: uses templates
mlkem.go - X.509 certificates → Attribute templates: builds templates
certificates.go - Token context → Session pool: leases sessions
sessions.go - PKCS#11 bindings → PKCS#11 token: performs PKCS#11 operations
README.md