/* * PEM Encoding/Decoding * (C) 1999-2007 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_PEM_H__ #define BOTAN_PEM_H__ #include namespace Botan { namespace PEM_Code { /** * Encode some binary data in PEM format */ BOTAN_DLL std::string encode(const byte der[], size_t der_len, const std::string& label, size_t line_width = 64); /** * Encode some binary data in PEM format */ BOTAN_DLL std::string encode(const MemoryRegion& der, const std::string& label, size_t line_width = 64); /** * Decode PEM data * @param label is set to the PEM label found for later inspection */ BOTAN_DLL SecureVector decode(DataSource& pem, std::string& label); /** * Decode PEM data * @param label is set to the PEM label found for later inspection */ BOTAN_DLL SecureVector decode(const std::string& pem, std::string& label); /** * Decode PEM data * @param label is what we expect the label to be */ BOTAN_DLL SecureVector decode_check_label( DataSource& pem, const std::string& label); /** * Decode PEM data * @param label is what we expect the label to be */ BOTAN_DLL SecureVector decode_check_label( const std::string& pem, const std::string& label); /** * Heuristic test for PEM data. */ BOTAN_DLL bool matches(DataSource& source, const std::string& extra = "", size_t search_range = 4096); } } #endif