1 /* 2 * Copyright 2014-2022 The GmSSL Project. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the License); you may 5 * not use this file except in compliance with the License. 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 */ 9 10 11 #ifndef GMSSL_PEM_H 12 #define GMSSL_PEM_H 13 14 15 #include <stdio.h> 16 #include <string.h> 17 #include <stdlib.h> 18 #include <gmssl/base64.h> 19 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 26 int pem_read(FILE *fp, const char *name, uint8_t *out, size_t *outlen, size_t maxlen); 27 int pem_write(FILE *fp, const char *name, const uint8_t *in, size_t inlen); 28 29 30 #ifdef __cplusplus 31 } 32 #endif 33 #endif 34