nx_x509_pubkey_rsa.nx
buildroot/runtime/nx_x509_pubkey_rsa.nx
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
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
| 43 | const NX_X509_PUBKEY_RSA_OK: i64 = 1 |
| 44 | const NX_X509_PUBKEY_RSA_BAD_SEQUENCE: i64 = 2 |
| 45 | const NX_X509_PUBKEY_RSA_BAD_N: i64 = 3 |
| 46 | const NX_X509_PUBKEY_RSA_BAD_E: i64 = 4 |
| 47 | const NX_X509_PUBKEY_RSA_VERDICT_N: i64 = 5 |
functions
| 49 | func nx_x509_pubkey_rsa_verdict_is_valid(v: i64) -> i64 |
| 56 | func nx_x509_pubkey_extract_rsa(buf: *u8, cert: *X509Cert, |
| 129 | func main() -> i64 |