Skip to main content

Module krb5

Module krb5 

Source
Expand description

Python bindings for Kerberos V5 and PKINIT types from synta_krb5.

This module builds the synta.krb5 Python submodule, exposing the Kerberos V5 and PKINIT ASN.1 types needed for certificate construction and for parsing Kerberos AS exchanges.

§Contents

§Principal-name support

  • PyKrb5PrincipalName — the RFC 4556 KRB5PrincipalName OtherName value embedded in PKINIT certificates.
  • KRB5_PRINCIPAL_NAME_OIDObjectIdentifier for id-pkinit-san (1.3.6.1.5.2.2, RFC 4556 §3.2.2).
  • NT_* integer constants — principal name types from RFC 4120 §6.2.

§PKINIT protocol types (RFC 4556 + RFC 6112 + RFC 8636)

Provided by crate::pkinit::register_pkinit_classes:

Python classRFC / sectionDescription
EncryptionKeyRFC 3961 §2Algorithm type and raw key material
ChecksumRFC 3961 §4Algorithm type and raw checksum bytes
KDFAlgorithmIdRFC 8636 §3.1KDF OID used in the PKINIT exchange
IssuerAndSerialNumberRFC 4556 §3.2.2Certificate identified by issuer + serial
ExternalPrincipalIdentifierRFC 4556 §3.2.2Certificate by name, issuer/serial, or SKI
PKAuthenticatorRFC 4556 §3.2.1Client proof of liveness in AS-REQ
AuthPackRFC 4556 §3.2.1Signed client authentication package
PaPkAsReqRFC 4556 §3.2.2PKINIT pre-authentication request
DHRepInfoRFC 4556 §3.2.4KDC Diffie-Hellman reply data
KDCDHKeyInfoRFC 4556 §3.2.4KDC DH public key and nonce
ReplyKeyPackRFC 4556 §3.2.3Session key and checksum from KDC
PaPkAsRepRFC 4556 §3.2.4PKINIT pre-authentication reply (CHOICE)

§Principal name types (NT_*)

ConstantValueRFC / sourceTypical use
NT_UNKNOWN0RFC 4120 §6.2Unknown / unspecified
NT_PRINCIPAL1RFC 4120 §6.2User or host principal
NT_SRV_INST2RFC 4120 §6.2Service + instance (e.g. krbtgt)
NT_SRV_HST3RFC 4120 §6.2Service + hostname
NT_SRV_XHST4RFC 4120 §6.2Service + host (remaining components)
NT_UID5RFC 4120 §6.2Unique ID
NT_X500_PRINCIPAL6RFC 4120 §6.2Encoded X.500 DN
NT_SMTP_NAME7RFC 4120 §6.2SMTP email address
NT_ENTERPRISE10RFC 6806 §5Enterprise principal (UPN-like)
NT_WELLKNOWN11RFC 8062 §3Well-known principal (anonymous)
NT_SRV_HST_DOMAIN12MS-SFU §2.1Host-based service (Windows)

§Register

Call register_krb5_module from the extension crate’s #[pymodule]:

krb5::register_krb5_module(m)?;

Structs§

PyKrb5PrincipalName
RFC 4556 KRB5PrincipalName — Kerberos principal embedded in a PKINIT certificate as an OtherName Subject Alternative Name.

Functions§

register_krb5_module
Build and register the synta.krb5 submodule into parent.