base64.h 844 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef UA_BASE64_H_
  2. #define UA_BASE64_H_
  3. #include <open62541/config.h>
  4. _UA_BEGIN_DECLS
  5. #include <stddef.h>
  6. /**
  7. * base64_encode - Base64 encode
  8. * @src: Data to be encoded
  9. * @len: Length of the data to be encoded
  10. * @out_len: Pointer to output length variable
  11. * Returns: Allocated buffer of out_len bytes of encoded data,
  12. * or %NULL on failure. The output is NOT Null-terminated. */
  13. unsigned char *
  14. UA_base64(const unsigned char *src, size_t len, size_t *out_len);
  15. /**
  16. * base64_decode - Base64 decode
  17. * @src: Data to be decoded
  18. * @len: Length of the data to be decoded
  19. * @out_len: Pointer to output length variable
  20. * Returns: Allocated buffer of out_len bytes of decoded data,
  21. * or %NULL on failure. */
  22. unsigned char *
  23. UA_unbase64(const unsigned char *src, size_t len, size_t *out_len);
  24. _UA_END_DECLS
  25. #endif /* UA_BASE64_H_ */