pem.h 631 B

123456789101112131415161718192021222324252627282930313233
  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. #ifndef GMSSL_PEM_H
  10. #define GMSSL_PEM_H
  11. #include <stdio.h>
  12. #include <string.h>
  13. #include <stdlib.h>
  14. #include <gmssl/base64.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. int pem_read(FILE *fp, const char *name, uint8_t *out, size_t *outlen, size_t maxlen);
  19. int pem_write(FILE *fp, const char *name, const uint8_t *in, size_t inlen);
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif