MAJOR=4
MINOR=67
DEVNAME=ttyS3
  $   /ˆl–Ðz¾”ªe¶…8 ^¸ÜdJbÑ¿Ö„œqßÑÀÔ ?÷     //*
 * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the Apache License 2.0 (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#ifndef OPENSSL_PEM_H
#define OPENSSL_PEM_H
#pragma once

#include <openssl/macros.h>
#ifndef OPENSSL_NO_DEPRECATED_3_0
#define HEADER_PEM_H
#endif

#include <openssl/e_os2.h>
#include <openssl/bio.h>
#include <openssl/safestack.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pemerr.h>
#ifndef OPENSSL_NO_STDIO
#include <stdio.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define PEM_BUFSIZE 1024

#define PEM_STRING_X509_OLD "X509 CERTIFICATE"
#define PEM_STRING_X509 "CERTIFICATE"
#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
#define PEM_STRING_X509_CRL "X509 CRL"
#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
#define PEM_STRING_PUBLIC "PUBLIC KEY"
#define PEM_STRING_RSA "RSA PRIVATE KEY"
#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
#define PEM_STRING_DSA "DSA PRIVATE KEY"
#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
#define PEM_STRING_PKCS7 "PKCS7"
#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA"
#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
#define PEM_STRING_PKCS8INF "PRIVATE KEY"
#define PEM_STRING_DHPARAMS "DH PARAMETERS"
#define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS"
#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
#define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
#define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
#define PEM_STRING_PARAMETERS "PARAMETERS"
#define PEM_STRING_CMS "CMS"
#define PEM_STRING_SM2PRIVATEKEY "SM2 PRIVATE KEY"
#define PEM_STRING_SM2PARAMETERS "SM2 PARAMETERS"
#define PEM_STRING_ACERT "ATTRIBUTE CERTIFICATE"

#define PEM_TYPE_ENCRYPTED 10
#define PEM_TYPE_MIC_ONLY 20
#define PEM_TYPE_MIC_CLEAR 30
#define PEM_TYPE_CLEAR 40

/*
 * These macros make the PEM_read/PEM_write functions easier to maintain and
 * write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or
 * IMPLEMENT_PEM_rw_cb(...)
 */

#define PEM_read_cb_fnsig(name, type, INTYPE, readname)  \
    type *PEM_##readname##_##name(INTYPE *out, type **x, \
        pem_password_cb *cb, void *u)
#define PEM_read_cb_ex_fnsig(name, type, INTYPE, readname)    \
    type *PEM_##readname##_##name##_ex(INTYPE *out, type **x, \
        pem_password_cb *cb, void *u,                         \
        OSSL_LIB_CTX *libctx,                                 \
        const char *propq)

#define PEM_write_fnsig(name, type, OUTTYPE, writename) \
    int PEM_##writename##_##name(OUTTYPE *out, const type *x)
#define PEM_write_cb_fnsig(name, type, OUTTYPE, writename)    \
    int PEM_##writename##_##name(OUTTYPE *out, const type *x, \
        const EVP_CIPHER *enc,                                \
        const unsigned char *kstr, int klen,                  \
        pem_password_cb *cb, void *u)
#define PEM_write_ex_fnsig(name, type, OUTTYPE, writename)         \
    int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \
        OSSL_LIB_CTX *libctx,                                      \
        const char *propq)
#define PEM_write_cb_ex_fnsig(name, type, OUTTYPE, writename)      \
    int PEM_##writename##_##name##_ex(OUTTYPE *out, const type *x, \
        const EVP_CIPHER *enc,                                     \
        const unsigned char *kstr, int klen,                       \
        pem_password_cb *cb, void *u,                              \
        OSSL_LIB_CTX *libctx,                                      \
        const char *propq)

#ifdef OPENSSL_NO_STDIO

#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/
#define IMPLEMENT_PEM_write_fp(na