Decode the PEM envelope
A certificate PEM block contains Base64 text between CERTIFICATE boundary lines. Decoding that text recovers the DER-encoded X.509 Certificate structure, whose ASN.1 fields identify the certificate version, serial number, signature information, issuer, validity period, subject, public-key information, and optional extensions. A CSR, private key, or public-key PEM block is a different structure and is not interchangeable with a certificate.