Function pemtob64

  • get Base64 string from PEM format data

    Parameters

    • pem: string

      PEM formatted string

    • Optional sHead: string

      PEM header string without BEGIN/END

    Returns string

    Base64 string

    Description

    This static method gets a Base64 string of contents from PEM format data.

    Example

    pemtob64("-----BEGIN CERTIFICATE...", "CERTIFICATE") -> "MIIBvTCC..."
    pemtob64("-----BEGIN CERTIFICATE...") -> "MIIBvTCC..."