parse_x509
Type: Function · Category: parsers
Parse a DER encoded x509 string into an object.
If you have a base64 encoded certificate you will first need to strip the header and footer and decode it, as shown in the example below.
Example
SELECT parse_x509(
data=base64decode(
string=regex_transform(
source=ca_certificate,
map=dict(
`-+BEGIN CERTIFICATE-+`="",
`\n`="",
`-+END CERTIFICATE-+`=""),
key="A")))[0] AS ca_cert
FROM config
| Argument | Type | Description |
|---|---|---|
data |
string (required) | X509 DER encoded string. |
Platforms: macOS, Linux, Windows