Last active
January 27, 2025 15:50
-
-
Save binura-g/23414a9d6320f6325d58f9f9f8873741 to your computer and use it in GitHub Desktop.
Convert Certificates ( .pem, / .crt / etc ) into single-line strings for JSON payloads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-----BEGIN CERTIFICATE-----
MIIFQjCCAyqgAwIBAgIUMXrEwkzTeuq3Hi1dZ2xnRgU/oxQwDQYJKoZIhvcNAQEL
BQAwGTEXMBUGA1UEAwwObXkteDUwOS1kZXZpY2UwHhcNMjQwNTAyMDU1NzQ3WhcN
MjQwNjAxMDU1NzQ3WjAZMRcwFQYDVQQDDA5teS14NTA5LWRldmljZTCCAiIwDQYJ
KoZIhvcNAQEBBQADggIPADCCAgoCggIBAIZvzsxpKvCFUN8hfbXS1oYBrhyR4hjb
SDXLiwpmAphU6+kEbefSg+AqTJMGzMKFw87EIvhMAEeIyq1+7i9qQ61s6LdFLgWA
w8iyW/0y/oDQjUX+ECUk42TUjDeVoLdwyGZ/UYHBuhSXoGpbPn00vksNR3VqrTYI
RoYx3PXg1wvxVdeWuZQEvywJkiYAUrR6HviE7M7XQBhRnIdQEYPvgBln+tU+As+q
9Su+cskduc9BQcBXYX3GOXXx48ReErnM6QdaI15wBzaA6vt3Rn07Dn0J+DG2eA6c
9KJdmgVWo77uYLCVAKVbo+KlqRHKWEeHTfrMzj1o/NmoB7IEVT3vLR47w3PJD77o
xScsnV0CvsaIKIM5HlzW+F7vMngA6scpNSYkjh3J6vT6RRVLrQ7+CWrklnVUrHB7
5fm7y4IFB+c8QlHTfXbpIg1fAtsa0h08Auu47DMIGhmQqXpjubTYsN83t0nPWtYG
gGA2EBlzr3y/hS2eF0gfVChTkBwZyvCd3Vu5OoSBBgxqeLO+zCwFPsOicnxcas5R
NFt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