Thursday, 21 September 2023

Cat Pem into singline string, make public private key from p12 . Print pem file with in a single line string (useful for saml 2024) - convert cert to string!!! 2025

 https://serverfault.com/questions/466683/can-an-ssl-certificate-be-on-a-single-line-in-a-file-no-line-breaks


//clean up your pem to remove bag attributes

1) print a single line string with \n for line breaks(this is needed because many software will not working properly with

awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}'  ca.pem

2) print a single line string without \n (SAML metadata etc)

awk 'NF {sub(/\r/, ""); printf "%s",$0;}' ca.pem

make public private key from p12

openssl pkcs12 -in my.p12 -out fullchain.pem -clcerts -nokeys
openssl pkcs12 -in my.p12 -nodes -nocerts -out privkey.pem

No comments:

Post a Comment