X.509 Certificate
- •
What it is
- •
The standard format for a public-key certificate: it binds a public key to identity information (domain name, organization) and is digitally signed by a Certificate Authority (CA), forming the chain of trust behind HTTPS/TLS. Key fields include the Subject, Issuer, validity period, and the Subject Public Key Info (SPKI) — the actual public key, DER-encoded.
- •
- •
When to apply
- •
A challenge gives you a certificate (
.pem/.der/.crt) and asks about its metadata (modulus, subject, fingerprint) rather than performing an attack on the cryptography itself.
- •
- •
Worked example
- •
openssl x509 -in cert.pem -noout -subject -issuer -modulusprints the CN, issuing CA, and RSA modulus straight out of the certificate structure.
- •
- •
Python
- •
from Crypto.PublicKey import RSA from Crypto.Util.asn1 import DerSequence # PyCryptodome can pull the public key straight out of a cert's DER bytes key = RSA.import_key(open("cert.der","rb").read()) print(key.n)
- •
- •
- •