hexadecimal string of PEM body
PEM header string (ex. 'RSA PRIVATE KEY')
new line string
PEM formatted string of input data
This function converts a hexadecimal string to a PEM string with a specified header. Its line break will be CRLF("\r\n").
hextopem('616161', 'RSA PRIVATE KEY') ->
-----BEGIN PRIVATE KEY-----
YWFh
-----END PRIVATE KEY-----
get PEM string from hexadecimal data and header string