void PEM_proc_type(char *buf, int type)
{
    const char *str;

    if (type == PEM_TYPE_ENCRYPTED)
        str = "ENCRYPTED";
    else if (type == PEM_TYPE_MIC_CLEAR)
        str = "MIC-CLEAR";
    else if (type == PEM_TYPE_MIC_ONLY)
        str = "MIC-ONLY";
    else
        str = "BAD-TYPE";

    OPENSSL_strlcat(buf, "Proc-Type: 4,", PEM_BUFSIZE);
    OPENSSL_strlcat(buf, str, PEM_BUFSIZE);
    OPENSSL_strlcat(buf, "\n", PEM_BUFSIZE);
}