This package provides some functions to quickly view the details of a certificate using x509-mode. This is mainly useful when the Base64-, DER encoded data of a certificate is enclosed in a larger file, like an XML file.
x509-view-certificate
: View the X509 certificate under the point.x509-view-region-as-x509-certificate
: Interpret the current region as X509 certificate.x509-view-xml-element-as-x509-certificate
: Interpret the current XML element under the point as X509 certificate.x509-view-paragraph-as-x509-certificate
: Interpret the current paragraph as X509 certificate.
These functions will create a temporary buffer containing the
certificate data, prepend/append ----- BEGIN/END CERTIFICATE-----
and display the buffer using x509-mode
, which shows the
openssl
output in a read-only buffer. This buffer can be closed
by pressing q
.
Since this package is not (yet) published on MELPA, the easiest
way to install it is directly from the git sources. For example
by using straight
or quelpa
.
The below snippets both use use-package
to install
x509-certificate-region
and to register key-bindings for the
main functions.
(use-package x509-certificate-region
:straight
(x509-certificate-region
:type git
:host github
:repo "peterpaul/x509-certificate-region.el")
:bind (("C-x x c" . x509-view-certificate)
("C-x x x" . x509-view-xml-element-as-x509-certificate)
("C-x x r" . x509-view-region-as-x509-certificate)
("C-x x p" . x509-view-paragraph-as-x509-certificate)))
(use-package x509-certificate-region
:quelpa
(x509-certificate-region
:fetcher github
:repo "peterpaul/x509-certificate-region.el")
:bind (("C-x x c" . x509-view-certificate)
("C-x x x" . x509-view-xml-element-as-x509-certificate)
("C-x x r" . x509-view-region-as-x509-certificate)
("C-x x p" . x509-view-paragraph-as-x509-certificate)))