code wiki / (root) / nx_x509_pubkey_rsa.nx

nx_x509_pubkey_rsa.nx

buildroot/runtime/nx_x509_pubkey_rsa.nx

4357 B131 linesdepth 4pulls 5 transitivereach 526 importersview sourcekind tooltopic x509
docsdependenciesstructsconstsfunctions

about

nx_x509_pubkey_rsa.nx -- extract an RSA-2048 public key (n, e) from an X.509 SubjectPublicKeyInfo. Parallel to nx_x509_pubkey_ec.nx; reads the cert.pubkey_off/_len bytes (the BIT STRING contents, with the unused-bits byte already stripped by x509_parse). The contents are a DER-encoded RSAPublicKey ::= SEQUENCE { modulus INTEGER, -- n (2048-bit unsigned) publicExponent INTEGER -- e (typically 65537) } Public API: nx_x509_pubkey_extract_rsa(buf, cert, out_n_2048, out_e_p) -> verdict Writes: out_n_2048: 64-limb LE U2048 modulus *out_e_p: i64 public exponent Sealed verdict: NX_X509_PUBKEY_RSA_OK NX_X509_PUBKEY_RSA_BAD_SEQUENCE outer SEQUENCE missing/malformed NX_X509_PUBKEY_RSA_BAD_N n INTEGER missing/out-of-range NX_X509_PUBKEY_RSA_BAD_E e INTEGER missing/oversized Per Cardinals 9, 12, 23. license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_8017 + rfc_5280 lineage_id: nishi_x509_pubkey_rsa_q10

dependencies 4 imports · 8 importers

nx_syscalls.nx nx_asn1.nx nx_u2048.nx nx_x509.nx nx_x509_pubkey_rsa.nx nx_tls12_client.nx nx_tls12_client_session.nx nx_tls12_mutant.nx nx_tls12_req.nx nx_tls13_client_verify_cv.nx nx_x509_trust_root_kat.nx nx_x509_verify_rsa_gate.nx nx_x509_verify_under_issuer.nx

imports: nx_syscalls.nxnx_asn1.nxnx_u2048.nxnx_x509.nx

imported by: nx_tls12_client.nxnx_tls12_client_session.nxnx_tls12_mutant.nxnx_tls12_req.nxnx_tls13_client_verify_cv.nxnx_x509_trust_root_kat.nxnx_x509_verify_rsa_gate.nxnx_x509_verify_under_issuer.nx

structs

none

consts

43const NX_X509_PUBKEY_RSA_OK: i64 = 1
44const NX_X509_PUBKEY_RSA_BAD_SEQUENCE: i64 = 2
45const NX_X509_PUBKEY_RSA_BAD_N: i64 = 3
46const NX_X509_PUBKEY_RSA_BAD_E: i64 = 4
47const NX_X509_PUBKEY_RSA_VERDICT_N: i64 = 5

functions

49func nx_x509_pubkey_rsa_verdict_is_valid(v: i64) -> i64
56func nx_x509_pubkey_extract_rsa(buf: *u8, cert: *X509Cert,
129func main() -> i64