Diferencias
Muestra las diferencias entre dos versiones de la página.
| Próxima revisión | Revisión previa | ||
| python_crypto [2023/10/30 22:05] – creado ivan | python_crypto [2023/10/30 22:06] (actual) – ivan | ||
|---|---|---|---|
| Línea 4: | Línea 4: | ||
| <code python> | <code python> | ||
| from OpenSSL import crypto | from OpenSSL import crypto | ||
| + | |||
| certificate = crypto.load_certificate(crypto.FILETYPE_ASN1, | certificate = crypto.load_certificate(crypto.FILETYPE_ASN1, | ||
| + | not_after = datetime.strptime(certificate.get_notAfter().decode(' | ||
| + | not_before = datetime.strptime(certificate.get_notBefore().decode(' | ||
| + | serial_number = f' | ||
| + | ext_count = certificate.get_extension_count() | ||
| + | print(certificate.get_subject().x500UniqueIdentifier) | ||
| + | print(certificate.get_subject().serialNumber) | ||
| + | print(certificate.get_subject().OU) | ||
| + | print(certificate.get_subject().emailAddress) | ||
| </ | </ | ||