Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyTLSReadinessPolicy(report *InventoryReport, policyID string, now time.Time) error
- func DefaultMTCTreeheadLogID(source string) string
- func MTCLeafHash(entry MTCLogEntry) (string, error)
- func MTCTreeheadEntryID(entry MTCTreeheadEntry) (string, error)
- func MerkleRootHex(leaves [][]byte) string
- func ParseRevocationSubject(subjectType, subject string) (string, string, error)
- func PublicKeyFingerprint(publicKey []byte) string
- func RevocationEventID(event RevocationEvent) (string, error)
- func RevocationManifestDigest(manifest RevocationManifest) (string, error)
- func RevocationManifestRoot(manifest RevocationManifest) (string, error)
- func SignAuditCheckpoint(ctx context.Context, manager interface{ ... }, checkpoint *AuditCheckpoint, ...) error
- func SignMTCCheckpoint(ctx context.Context, manager interface{ ... }, checkpoint *MTCCheckpoint, ...) error
- func SignTransparencyCheckpoint(ctx context.Context, manager interface{ ... }, ...) error
- func ValidateRevocationManifest(manifest RevocationManifest) error
- func VerifyAuditCheckpoint(r io.Reader, checkpoint *AuditCheckpoint, publicKey *PublicKey) error
- func VerifyMTCProof(proof *MTCProof, checkpoint *MTCCheckpoint, publicKey *PublicKey) error
- func VerifyTransparencyBundle(bundle TransparencyBundle, publicKey *PublicKey) error
- func VerifyTransparencyCheckpoint(report InventoryReport, checkpoint *TransparencyCheckpoint, ...) error
- func VerifyTransparencyCheckpointWithRevocations(report InventoryReport, revocations *RevocationManifest, ...) error
- func VerifyWithPublicKey(publicKey PublicKey, message []byte, sig *SignatureEnvelope) error
- func WriteRevocationManifest(w io.Writer, manifest RevocationManifest) error
- type Algorithm
- type AuditCheckpoint
- type AuditEvent
- type Auditor
- type AuditorFunc
- type EncryptOptions
- type Envelope
- type FileAuditor
- type GenerateRequest
- type InventoryEntry
- type InventoryReport
- type KeyMetadata
- type KeyRecord
- type KeyUse
- type MTCCheckpoint
- type MTCLog
- type MTCLogEntry
- type MTCProof
- type MTCProofNode
- type MTCTreeheadCache
- type MTCTreeheadEntry
- type MTCTreeheadFinding
- type MTCTreeheadVerifyResult
- type Manager
- func (m *Manager) Decrypt(ctx context.Context, envelope *Envelope, opts EncryptOptions) (plaintext []byte, err error)
- func (m *Manager) Encrypt(ctx context.Context, keyID string, plaintext []byte, opts EncryptOptions) (envelope *Envelope, err error)
- func (m *Manager) ExportPublic(ctx context.Context, id string) (publicKey *PublicKey, err error)
- func (m *Manager) Generate(ctx context.Context, req GenerateRequest) (meta *KeyMetadata, err error)
- func (m *Manager) Get(ctx context.Context, id string) (meta *KeyMetadata, err error)
- func (m *Manager) List(ctx context.Context) (keys []KeyMetadata, err error)
- func (m *Manager) Rotate(ctx context.Context, id string) (meta *KeyMetadata, err error)
- func (m *Manager) Sign(ctx context.Context, keyID string, message []byte, opts SignOptions) (signature *SignatureEnvelope, err error)
- func (m *Manager) Verify(ctx context.Context, message []byte, sig *SignatureEnvelope) (err error)
- type Option
- type PublicKey
- type ReadinessCategory
- type ReadinessCoverage
- type ReadinessFinding
- type ReadinessScan
- type RevocationEvent
- type RevocationManifest
- type SignOptions
- type SignatureEnvelope
- type Store
- type TLSCertificate
- type TLSInspectOptions
- type TLSReadiness
- type TLSReadinessPolicy
- type TLSReport
- type TransparencyBundle
- type TransparencyCheckpoint
Constants ¶
const ( MerkleHashSHA256 = "SHA-256" AuditCheckpointSchema = "pqc.audit-checkpoint.v1" InventoryReportSchema = "pqc.inventory.v1" TransparencyCheckpointSchema = "pqc.transparency-checkpoint.v1" TransparencyBundleSchema = "pqc.transparency-bundle.v1" )
const ( EnvelopeSchema = "pqc.envelope.v1" SignatureSchema = "pqc.signature.v1" KDFHKDFSHA256 = "HKDF-SHA256" AEADAES256GCM = "AES-256-GCM" )
const ( MTCLogSchema = "pqc.mtc-log.v1" MTCCheckpointSchema = "pqc.mtc-checkpoint.v1" MTCProofSchema = "pqc.mtc-proof.v1" )
const ( TLSVerificationSystem = "system" TLSVerificationCustom = "custom" TLSVerificationSkipped = "skipped" )
const (
MTCTreeheadCacheSchema = "pqc.mtc-treehead-cache.v1"
)
const (
ReadinessScanSchema = "pqc.readiness-scan.v1"
)
const (
RevocationManifestSchema = "pqc.revocation-manifest.v1"
)
const (
TLSReadinessPolicyPublicWeb2029 = "public-web-2029"
)
Variables ¶
Functions ¶
func ApplyTLSReadinessPolicy ¶
func ApplyTLSReadinessPolicy(report *InventoryReport, policyID string, now time.Time) error
func DefaultMTCTreeheadLogID ¶
func MTCLeafHash ¶
func MTCLeafHash(entry MTCLogEntry) (string, error)
func MTCTreeheadEntryID ¶
func MTCTreeheadEntryID(entry MTCTreeheadEntry) (string, error)
func MerkleRootHex ¶
func ParseRevocationSubject ¶
func PublicKeyFingerprint ¶
func RevocationEventID ¶
func RevocationEventID(event RevocationEvent) (string, error)
func RevocationManifestDigest ¶
func RevocationManifestDigest(manifest RevocationManifest) (string, error)
func RevocationManifestRoot ¶
func RevocationManifestRoot(manifest RevocationManifest) (string, error)
func SignAuditCheckpoint ¶
func SignAuditCheckpoint(ctx context.Context, manager interface { Sign(context.Context, string, []byte, SignOptions) (*SignatureEnvelope, error) }, checkpoint *AuditCheckpoint, signKey string) error
func SignMTCCheckpoint ¶
func SignMTCCheckpoint(ctx context.Context, manager interface { Sign(context.Context, string, []byte, SignOptions) (*SignatureEnvelope, error) }, checkpoint *MTCCheckpoint, signKey string) error
func SignTransparencyCheckpoint ¶
func SignTransparencyCheckpoint(ctx context.Context, manager interface { Sign(context.Context, string, []byte, SignOptions) (*SignatureEnvelope, error) }, checkpoint *TransparencyCheckpoint, signKey string) error
func ValidateRevocationManifest ¶
func ValidateRevocationManifest(manifest RevocationManifest) error
func VerifyAuditCheckpoint ¶
func VerifyAuditCheckpoint(r io.Reader, checkpoint *AuditCheckpoint, publicKey *PublicKey) error
func VerifyMTCProof ¶
func VerifyMTCProof(proof *MTCProof, checkpoint *MTCCheckpoint, publicKey *PublicKey) error
func VerifyTransparencyBundle ¶
func VerifyTransparencyBundle(bundle TransparencyBundle, publicKey *PublicKey) error
func VerifyTransparencyCheckpoint ¶
func VerifyTransparencyCheckpoint(report InventoryReport, checkpoint *TransparencyCheckpoint, publicKey *PublicKey) error
func VerifyTransparencyCheckpointWithRevocations ¶
func VerifyTransparencyCheckpointWithRevocations(report InventoryReport, revocations *RevocationManifest, checkpoint *TransparencyCheckpoint, publicKey *PublicKey) error
func VerifyWithPublicKey ¶
func VerifyWithPublicKey(publicKey PublicKey, message []byte, sig *SignatureEnvelope) error
VerifyWithPublicKey verifies a signature envelope against an exported public key without opening a private key store.
func WriteRevocationManifest ¶
func WriteRevocationManifest(w io.Writer, manifest RevocationManifest) error
Types ¶
type Algorithm ¶
type Algorithm string
Algorithm identifies a supported post-quantum primitive.
func ParseAlgorithm ¶
ParseAlgorithm accepts canonical names and common aliases used by earlier PQC drafts and libraries.
type AuditCheckpoint ¶
type AuditCheckpoint struct {
Schema string `json:"schema"`
Hash string `json:"hash"`
LeafCount int `json:"leaf_count"`
MerkleRoot string `json:"merkle_root"`
AuditDigest string `json:"audit_digest"`
CreatedAt time.Time `json:"created_at"`
Signature *SignatureEnvelope `json:"signature,omitempty"`
}
func BuildAuditCheckpoint ¶
type AuditEvent ¶
type AuditEvent struct {
Time time.Time `json:"time"`
Operation string `json:"operation"`
KeyID string `json:"key_id,omitempty"`
Algorithm Algorithm `json:"algorithm,omitempty"`
KeyVersion int `json:"key_version,omitempty"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
AuditEvent is a metadata-only record for key manager operations. It must not contain key material, plaintext, ciphertext, signatures, or shared secrets.
type Auditor ¶
type Auditor interface {
Record(context.Context, AuditEvent) error
}
Auditor records metadata-only key manager events.
type AuditorFunc ¶
type AuditorFunc func(context.Context, AuditEvent) error
AuditorFunc adapts a function to Auditor.
func (AuditorFunc) Record ¶
func (f AuditorFunc) Record(ctx context.Context, event AuditEvent) error
type EncryptOptions ¶
type EncryptOptions struct {
AAD []byte
}
type Envelope ¶
type Envelope struct {
Schema string `json:"schema"`
KeyID string `json:"key_id"`
KeyVersion int `json:"key_version"`
KEM Algorithm `json:"kem"`
KDF string `json:"kdf"`
AEAD string `json:"aead"`
Salt []byte `json:"salt"`
EncapsulatedKey []byte `json:"encapsulated_key"`
Nonce []byte `json:"nonce"`
Ciphertext []byte `json:"ciphertext"`
CreatedAt time.Time `json:"created_at"`
}
Envelope contains an ML-KEM encapsulated content-encryption key and an AEAD ciphertext. Byte slices are base64 encoded when marshaled as JSON.
type FileAuditor ¶
type FileAuditor struct {
// contains filtered or unexported fields
}
FileAuditor appends one JSON audit event per line.
func NewFileAuditor ¶
func NewFileAuditor(path string) (*FileAuditor, error)
func (*FileAuditor) Record ¶
func (a *FileAuditor) Record(ctx context.Context, event AuditEvent) error
type GenerateRequest ¶
type InventoryEntry ¶
type InventoryReport ¶
type InventoryReport struct {
Schema string `json:"schema"`
CreatedAt time.Time `json:"created_at"`
Policy string `json:"policy,omitempty"`
KeyStoreScanned bool `json:"key_store_scanned,omitempty"`
Keys []InventoryEntry `json:"keys,omitempty"`
Targets []TLSReport `json:"targets,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
func BuildInventoryReport ¶
func BuildInventoryReport(keys []KeyMetadata, targets []TLSReport, now time.Time) InventoryReport
type KeyMetadata ¶
type MTCCheckpoint ¶
type MTCCheckpoint struct {
Schema string `json:"schema"`
Hash string `json:"hash"`
TreeSize int `json:"tree_size"`
MerkleRoot string `json:"merkle_root"`
GeneratedAt time.Time `json:"generated_at"`
Signature *SignatureEnvelope `json:"signature,omitempty"`
}
func BuildMTCCheckpoint ¶
func BuildMTCCheckpoint(log MTCLog, now time.Time) (*MTCCheckpoint, error)
type MTCLog ¶
type MTCLog struct {
Schema string `json:"schema"`
Hash string `json:"hash"`
CreatedAt time.Time `json:"created_at"`
Entries []MTCLogEntry `json:"entries,omitempty"`
}
type MTCLogEntry ¶
type MTCProof ¶
type MTCProof struct {
Schema string `json:"schema"`
Hash string `json:"hash"`
LeafIndex int `json:"leaf_index"`
TreeSize int `json:"tree_size"`
Leaf MTCLogEntry `json:"leaf"`
Siblings []MTCProofNode `json:"siblings,omitempty"`
MerkleRoot string `json:"merkle_root"`
GeneratedAt time.Time `json:"generated_at"`
}
type MTCProofNode ¶
type MTCTreeheadCache ¶
type MTCTreeheadCache struct {
Schema string `json:"schema"`
Source string `json:"source,omitempty"`
FetchedAt time.Time `json:"fetched_at"`
Treeheads []MTCTreeheadEntry `json:"treeheads"`
}
func NewMTCTreeheadCache ¶
func NewMTCTreeheadCache(source string, entries []MTCTreeheadEntry, now time.Time) MTCTreeheadCache
func ParseMTCTreeheadSource ¶
type MTCTreeheadEntry ¶
type MTCTreeheadEntry struct {
ID string `json:"id"`
LogID string `json:"log_id"`
Source string `json:"source,omitempty"`
Checkpoint MTCCheckpoint `json:"checkpoint"`
PublicKey PublicKey `json:"public_key"`
ReceivedAt time.Time `json:"received_at"`
}
func NewMTCTreeheadEntry ¶
func NewMTCTreeheadEntry(source, logID string, checkpoint MTCCheckpoint, publicKey PublicKey, now time.Time) (MTCTreeheadEntry, error)
type MTCTreeheadFinding ¶
type MTCTreeheadVerifyResult ¶
type MTCTreeheadVerifyResult struct {
OK bool `json:"ok"`
Verified int `json:"verified"`
Findings []MTCTreeheadFinding `json:"findings,omitempty"`
}
func VerifyMTCTreeheadCache ¶
func VerifyMTCTreeheadCache(cache MTCTreeheadCache) (*MTCTreeheadVerifyResult, error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) ExportPublic ¶
func (*Manager) Generate ¶
func (m *Manager) Generate(ctx context.Context, req GenerateRequest) (meta *KeyMetadata, err error)
func (*Manager) Sign ¶
func (m *Manager) Sign(ctx context.Context, keyID string, message []byte, opts SignOptions) (signature *SignatureEnvelope, err error)
type ReadinessCategory ¶
type ReadinessCoverage ¶
type ReadinessCoverage struct {
Confidence string `json:"confidence"`
ScoreImpact int `json:"score_impact"`
KeyStoreScanned bool `json:"key_store_scanned"`
KeyCount int `json:"key_count"`
TLSTargetsScanned bool `json:"tls_targets_scanned"`
TLSTargetCount int `json:"tls_target_count"`
TLSLifecycleReadinessTargetCount int `json:"tls_lifecycle_readiness_target_count"`
SystemVerifiedTargetCount int `json:"system_verified_target_count"`
CustomVerifiedTargetCount int `json:"custom_verified_target_count"`
UnverifiedTargetCount int `json:"unverified_target_count"`
}
type ReadinessFinding ¶
type ReadinessScan ¶
type ReadinessScan struct {
Schema string `json:"schema"`
CreatedAt time.Time `json:"created_at"`
Policy string `json:"policy,omitempty"`
Score int `json:"score"`
Level string `json:"level"`
Coverage ReadinessCoverage `json:"coverage"`
Summary string `json:"summary"`
Categories []ReadinessCategory `json:"categories"`
Findings []ReadinessFinding `json:"findings,omitempty"`
Inventory InventoryReport `json:"inventory"`
}
func BuildReadinessScan ¶
func BuildReadinessScan(report InventoryReport, now time.Time) ReadinessScan
type RevocationEvent ¶
type RevocationManifest ¶
type RevocationManifest struct {
Schema string `json:"schema"`
Hash string `json:"hash"`
CreatedAt time.Time `json:"created_at"`
Events []RevocationEvent `json:"events,omitempty"`
}
func NewRevocationManifest ¶
func NewRevocationManifest(now time.Time) RevocationManifest
func ReadRevocationManifest ¶
func ReadRevocationManifest(r io.Reader) (RevocationManifest, error)
func (*RevocationManifest) Add ¶
func (m *RevocationManifest) Add(subjectType, subject, reason string, metadata map[string]any, now time.Time) (RevocationEvent, error)
type SignOptions ¶
type SignatureEnvelope ¶
type SignatureEnvelope struct {
Schema string `json:"schema"`
KeyID string `json:"key_id"`
KeyVersion int `json:"key_version"`
Algorithm Algorithm `json:"algorithm"`
Context []byte `json:"context,omitempty"`
Signature []byte `json:"signature"`
CreatedAt time.Time `json:"created_at"`
}
SignatureEnvelope carries an ML-DSA signature plus enough metadata to verify it later using the manager's key store.
type Store ¶
type Store interface {
Put(ctx context.Context, record KeyRecord) error
Get(ctx context.Context, id string) (KeyRecord, error)
GetVersion(ctx context.Context, id string, version int) (KeyRecord, error)
List(ctx context.Context) ([]KeyMetadata, error)
}
Store persists versioned key material. Implementations are responsible for protecting private keys at rest.
type TLSCertificate ¶
type TLSCertificate struct {
Subject string `json:"subject"`
Issuer string `json:"issuer"`
DNSNames []string `json:"dns_names,omitempty"`
NotBefore time.Time `json:"not_before"`
NotAfter time.Time `json:"not_after"`
SignatureAlgorithm string `json:"signature_algorithm"`
PublicKeyAlgorithm string `json:"public_key_algorithm"`
FingerprintSHA256 string `json:"fingerprint_sha256"`
RawBytes int `json:"raw_bytes"`
}
type TLSInspectOptions ¶
type TLSReadiness ¶
type TLSReadiness struct {
Policy TLSReadinessPolicy `json:"policy"`
Target string `json:"target"`
ReadyFor47DayCerts bool `json:"ready_for_47_day_certs"`
CertificateValidityDays int `json:"certificate_validity_days"`
DaysUntilExpiry int `json:"days_until_expiry"`
RenewalWindowRisk string `json:"renewal_window_risk"`
RecommendedRenewalCadenceDays int `json:"recommended_renewal_cadence_days"`
RecommendedRenewalLeadTimeDays int `json:"recommended_renewal_lead_time_days"`
SANCount int `json:"san_count"`
SANDCVReuseRisk string `json:"san_dcv_reuse_risk"`
SANDCVReuseRiskReason string `json:"san_dcv_reuse_risk_reason"`
ChainSizeBytes int `json:"chain_size_bytes"`
CertificateCount int `json:"certificate_count"`
LeafSignatureAlgorithm string `json:"leaf_signature_algorithm,omitempty"`
LeafPublicKeyAlgorithm string `json:"leaf_public_key_algorithm,omitempty"`
ChainSignatureAlgorithms []string `json:"chain_signature_algorithms,omitempty"`
ChainPublicKeyAlgorithms []string `json:"chain_public_key_algorithms,omitempty"`
HybridPQCKeyExchange bool `json:"hybrid_pqc_key_exchange"`
Verified bool `json:"verified"`
Findings []ReadinessFinding `json:"findings,omitempty"`
}
func EvaluateTLSReadiness ¶
func EvaluateTLSReadiness(report TLSReport, policy TLSReadinessPolicy, now time.Time) TLSReadiness
type TLSReadinessPolicy ¶
type TLSReadinessPolicy struct {
ID string `json:"id"`
Name string `json:"name"`
EffectiveDate time.Time `json:"effective_date"`
MaxValidityDays int `json:"max_validity_days"`
MaxDomainValidationReuseDays int `json:"max_domain_validation_reuse_days"`
RecommendedRenewalCadenceDays int `json:"recommended_renewal_cadence_days"`
RecommendedRenewalLeadTimeDays int `json:"recommended_renewal_lead_time_days"`
Source string `json:"source"`
}
func PublicWeb2029TLSReadinessPolicy ¶
func PublicWeb2029TLSReadinessPolicy() TLSReadinessPolicy
func ResolveTLSReadinessPolicy ¶
func ResolveTLSReadinessPolicy(id string) (TLSReadinessPolicy, error)
type TLSReport ¶
type TLSReport struct {
Target string `json:"target"`
ServerName string `json:"server_name,omitempty"`
TLSVersion string `json:"tls_version,omitempty"`
CipherSuite string `json:"cipher_suite,omitempty"`
KeyExchange string `json:"key_exchange,omitempty"`
HybridPQCKeyExchange bool `json:"hybrid_pqc_key_exchange"`
CertificateChainBytes int `json:"certificate_chain_bytes"`
CertificateCount int `json:"certificate_count"`
Verified bool `json:"verified"`
VerificationMode string `json:"verification_mode,omitempty"`
VerificationError string `json:"verification_error,omitempty"`
Leaf *TLSCertificate `json:"leaf,omitempty"`
Certificates []TLSCertificate `json:"certificates,omitempty"`
SignedCertificateStamps int `json:"signed_certificate_timestamps"`
OCSPStapled bool `json:"ocsp_stapled"`
ECHAccepted bool `json:"ech_accepted"`
InspectedAt time.Time `json:"inspected_at"`
Readiness *TLSReadiness `json:"readiness,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
func InspectTLS ¶
type TransparencyBundle ¶
type TransparencyBundle struct {
Schema string `json:"schema"`
Inventory InventoryReport `json:"inventory"`
Revocations *RevocationManifest `json:"revocations,omitempty"`
Checkpoint TransparencyCheckpoint `json:"checkpoint"`
}
func BuildTransparencyBundle ¶
func BuildTransparencyBundle(report InventoryReport, checkpoint *TransparencyCheckpoint) (TransparencyBundle, error)
func BuildTransparencyBundleWithRevocations ¶
func BuildTransparencyBundleWithRevocations(report InventoryReport, revocations *RevocationManifest, checkpoint *TransparencyCheckpoint) (TransparencyBundle, error)
type TransparencyCheckpoint ¶
type TransparencyCheckpoint struct {
Schema string `json:"schema"`
Hash string `json:"hash"`
GeneratedAt time.Time `json:"generated_at"`
KeyCount int `json:"key_count"`
TargetCount int `json:"target_count"`
RevocationCount int `json:"revocation_count"`
MerkleRoot string `json:"merkle_root"`
InventoryRoot string `json:"inventory_root"`
RevocationRoot string `json:"revocation_root,omitempty"`
RevocationDigest string `json:"revocation_digest,omitempty"`
Signature *SignatureEnvelope `json:"signature,omitempty"`
}
func BuildTransparencyCheckpoint ¶
func BuildTransparencyCheckpoint(report InventoryReport, now time.Time) (*TransparencyCheckpoint, error)
func BuildTransparencyCheckpointWithRevocations ¶
func BuildTransparencyCheckpointWithRevocations(report InventoryReport, revocations *RevocationManifest, now time.Time) (*TransparencyCheckpoint, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
pqc
command
|
|
|
pqcd
command
|
|
|
Package profile defines artifact profile plugins for PQC certificate, signature, and TLS authentication artifact families.
|
Package profile defines artifact profile plugins for PQC certificate, signature, and TLS authentication artifact families. |
|
profiles
|
|
|
store
|
|