This fork of step-ca uses the Agiligo Go variant to explore post-quantum cryptographic support. Agiligo is a modified version of the Go toolchain that adds cryptographic agility features, allowing the use of post-quantum algorithms not yet available in mainline Go.
This project requires Docker Compose - the Agiligo Go toolchain is built and configured automatically inside a container. All development must be done in the container environment.
# From project root - start the container
docker compose run --rm dev
# Inside container - verify setup
go version # Should show Agiligo-based Go
go env GOROOT # Should show /usr/local/agiligo
claude --version # Claude Code is pre-installed
# Initialize git submodules (automatically done on first run)
git submodule update --init --recursive
# Start Claude Code for AI assistance
claude
# Build step-ca
make build
# Run tests
make test
go.step.sm/crypto submodule added at ./crypto-agiligo (branch: agiligo-pqc)crypto-agiligo/x509compat/)
pemutil to use compatibility layer/go/pkg/mod/ cannot be patchedAgiligo reorganized crypto functions into algorithm-specific packages to support a registry-based crypto-agile architecture:
| Old Location (Standard Go) | New Location (Agiligo) |
|---|---|
x509.ParsePKCS1PrivateKey |
rsa.ParsePKCS1PrivateKey |
x509.ParsePKCS8PrivateKey |
pkcs8.UnmarshalPKCS8PrivateKey |
x509.ParseECPrivateKey |
ecdsa.ParseECPrivateKey |
x509.ParsePKIXPublicKey |
pkixparser.GetPublicKeyFromPKIXPublicKeyInfo (two-step) |
x509.MarshalPKCS1PrivateKey |
rsa.MarshalPKCS1PrivateKey |
x509.MarshalECPrivateKey |
ecdsa.MarshalECPrivateKey |
Agiligo replaces hard-coded algorithm lists with dynamic registration:
// Algorithms register themselves in init() functions
var crypto.PublicKeyAlgorithms map[string]PublicKeyAlgorithm
var crypto.SignatureAlgorithms map[string]SignatureAlgorithm
Critical requirement: Applications must import crypto/init or specific algorithm packages to register algorithms.
// New requirements in Agiligo
type PublicKey interface {
Equal(x PublicKey) bool // NEW
}
type PrivateKey interface {
Public() PublicKey
Equal(x PrivateKey) bool // NEW
}
x509.RSA, x509.ECDSA, x509.Ed25519 no longer existalgorithm.GetPublicKeyAlgorithmName() insteadCreated /workspace/crypto-agiligo/x509compat/ that provides the old x509 API as wrapper functions:
// Example: ParsePKCS8PrivateKey delegates to new location
func ParsePKCS8PrivateKey(der []byte) (crypto.PrivateKey, error) {
return pkcs8.UnmarshalPKCS8PrivateKey(der)
}
Coverage:
Usage in crypto-agiligo:
import (
_ "crypto/init" // Register all Agiligo algorithms
"go.step.sm/crypto/x509compat"
)
// Use old API names
key, err := x509compat.ParsePKCS8PrivateKey(derBytes)
crypto-agiligo/pemutil/pem.go - 11 function calls updatedcrypto-agiligo/pemutil/cosign.go - 1 function call updatedOur compatibility layer works perfectly for code we control, but cannot fix cached third-party dependencies.
High Priority (Core Functionality):
golang.org/x/crypto/ssh - SSH protocol operationsgolang.org/x/crypto/pkcs12 - PKCS#12 formatgithub.com/golang-jwt/jwt/v5 - JWT tokensgithub.com/Masterminds/sprig/v3 - Template functionsgithub.com/google/s2a-go - Google security (uses x509.RSA constants)Medium Priority (Cloud/Hardware):
cloud.google.com/go/auth - Google Cloud authenticationgolang.org/x/oauth2 - OAuth2 authenticationgithub.com/smallstep/scep - SCEP protocolgithub.com/smallstep/pkcs7 - PKCS#7 supportgithub.com/ThalesIgnite/crypto11 - PKCS#11/HSMgithub.com/go-piv/piv-go/v2 - YubiKey PIVThese dependencies are:
/go/pkg/mod/ (read-only cache)Impact:
Key Discovery: Agiligo does NOT ship with a compatible golang.org/x/crypto alternative.
Implication: Must fork golang.org/x/crypto and many other dependencies to proceed with Agiligo.
Strategy:
golang.org/x/crypto - Apply x509compat-style patches to ssh, pkcs12, ocsp packagesgithub.com/smallstep/scep and github.com/smallstep/pkcs7 (we control these)Pros:
Cons:
Use Cloudflare CIRCL instead of Agiligo:
Cloudflare CIRCL (https://github.com/cloudflare/circl) provides production-ready PQC algorithms:
Approach:
crypto.Signer interface for CIRCL ML-DSA keysPros:
Cons:
Wait for:
Pros: No maintenance burden
Cons: Could take months/years, blocks all progress
Phase 2: Fork Dependencies (8-12 weeks)
Phase 3: PQC Certificate Issuance (4-6 weeks)
Phase 4: Hybrid Certificates (4-6 weeks)
Total: 16-24 weeks
Phase 1: Proof of Concept (5-7 days)
Phase 2: Integration (2-3 weeks)
Phase 3: Production Ready (2-3 weeks)
Total: 5-7 weeks
| Aspect | Agiligo | Cloudflare CIRCL |
|---|---|---|
| Time to MVP | 8-12 weeks | 5-7 days |
| Dependency Forks | 10+ repositories | Zero |
| Maintenance | High (ongoing sync) | Low (standard Go) |
| Crypto-Agility | Full framework | Manual integration |
| Production Ready | Experimental | Battle-tested |
| Standards Support | FIPS 203/204 | FIPS 203/204 |
| Ecosystem | Emerging | Mature |
Choose PQC approach:
Priority 1: Fork golang.org/x/crypto
Priority 2: Fork Smallstep packages
Priority 3: Disable non-essential features
Priority 1: Proof of Concept
go get github.com/cloudflare/circlPriority 2: Design Integration
git submodule update --init --recursivego.step.sm/crypto replace directive points to ./crypto-agiligo in go.modGOWORK=off flag if encountering workspace issues# Rebuild container from scratch
docker compose build --no-cache
# Remove old containers/images
docker compose down
docker system prune -a
claude auth login (run on host, not in container)ls ~/.claude~/.claude to /root/.claude# Fix Go module cache permissions
sudo chown -R $(id -u):$(id -g) /go/pkg
/usr/local/agiligo/src//usr/local/agiligo/README*.mdWhen contributing to this Agiligo exploration:
docker compose run --rm dev)AGILIGO-TODO.md - Detailed task tracking and progresscrypto-agiligo/ - Git submodule for go.step.sm/crypto forkcrypto-agiligo/x509compat/ - Compatibility layer for Agiligo API changesDockerfile - Container build configurationdocker-compose.yml - Development environment setup