Expand description
§ms-pkca (pre-alpha)
PKINIT (RFC 4556) client for AD CS abuse — PA-PK-AS-REQ construction, DH shared-secret derivation, PA-PK-AS-REP parsing, and the “UnPAC-the-hash” primitive.
STATUS: 0.1.0-dev — offline structural encode + partial DH/KDF/PAC primitives. No network I/O. Not yet wire-compatible against a real KDC; that work needs live-DC iteration (planned 0.2).
§Modules
dh— RFC 4556 §3.2.1 Modp1024/Modp2048 groups + keypairkdf— RFC 4556 §3.2.3.1 octet-string-to-keycms— minimal RFC 5652 SignedData/ContentInfo encoderspkinit— AuthPack / PKAuthenticator / PA-PK-AS-REQ builderpac— PAC_CREDENTIAL_INFO parse + NT-hash extractionoid— PKINIT / CMS object identifierserror—Error/Result
§Minimal example
use ms_pkca::{PkinitClient, AsRepResult};
let client = PkinitClient::new("EXAMPLE.COM", "dc01.example.com:88");
let cert_pem = std::fs::read("client.pem").unwrap();
let key_pem = std::fs::read("client.key").unwrap();
// In 0.1.0-dev this returns a placeholder AsRepResult — no network is done.
let rep = client.request_tgt_with_cert(&cert_pem, &key_pem, "alice@example.com").unwrap();Re-exports§
Modules§
- cms
- Minimal CMS SignedData (RFC 5652) construction for PKINIT PA-PK-AS-REQ.
- dh
- Diffie-Hellman groups for PKINIT — RFC 4556 §3.2.1 / RFC 2412 (Oakley).
- enveloped
- CMS EnvelopedData (RFC 5652 §6) decrypt for the PA-PK-AS-REP.encKeyPack path.
- error
- Error type for ms-pkca.
- kdf
- RFC 4556 §3.2.3.1 — Octet-String-to-Key derivation used by PKINIT DH mode.
- network
- Kerberos AS-REQ TCP send + AS-REP processing (RFC 4120 §7.2.2, RFC 4556 §3.2).
- oid
- OIDs used by PKINIT (RFC 4556) and CMS.
- pac
- PAC_CREDENTIAL_INFO parsing — the “UnPAC-the-hash” primitive.
- pkinit
- PKINIT PA-PK-AS-REQ / PA-PK-AS-REP structure builders (RFC 4556 §3.2).
Structs§
- AsRep
Result - Result of a (would-be) AS-REQ / AS-REP exchange.
- Pkinit
Client - PKINIT client — realm + KDC endpoint.
Functions§
- unpac_
the_ hash - UnPAC-the-hash — pull the NT hash out of a decrypted PAC_CREDENTIAL_DATA blob returned inside PA-PK-AS-REP.
- unpac_
the_ hash_ from_ asrep - Convenience wrapper that operates on an
AsRepResult— will succeed once the AS-REP parser + decryption is wired in 0.2. For now it forwards tounpac_the_hashusingpac_credential_infoas if it were already decrypted.