From 80a73e43b54aeebc1265d96c634c0d69ea256193 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 24 Jan 2012 12:39:29 +0000 Subject: Better documentation in this header --- src/codec/pem/pem.h | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/src/codec/pem/pem.h b/src/codec/pem/pem.h index d15bfe978..0bcb85f5a 100644 --- a/src/codec/pem/pem.h +++ b/src/codec/pem/pem.h @@ -14,18 +14,41 @@ namespace Botan { namespace PEM_Code { -/* -* PEM Encoding/Decoding +/** +* 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 what we expect the label to be +*/ +BOTAN_DLL SecureVector decode_check_label( + DataSource& pem, + const std::string& label); + +/** +* Heuristic test for PEM data. */ -BOTAN_DLL std::string encode(const byte[], size_t, - const std::string&, size_t = 64); -BOTAN_DLL std::string encode(const MemoryRegion&, - const std::string&, size_t = 64); - -BOTAN_DLL SecureVector decode(DataSource&, std::string&); -BOTAN_DLL SecureVector decode_check_label(DataSource&, - const std::string&); -BOTAN_DLL bool matches(DataSource&, const std::string& = "", +BOTAN_DLL bool matches(DataSource& source, + const std::string& extra = "", size_t search_range = 4096); } -- cgit v1.2.3