diff options
author | lloyd <[email protected]> | 2012-01-24 12:39:29 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-24 12:39:29 +0000 |
commit | 80a73e43b54aeebc1265d96c634c0d69ea256193 (patch) | |
tree | 2c55657ee6a4122c61ac0ce123250e668117b5e3 /src/codec/pem | |
parent | f34cc48100c672824aa70869adfb59669055d173 (diff) |
Better documentation in this header
Diffstat (limited to 'src/codec/pem')
-rw-r--r-- | src/codec/pem/pem.h | 45 |
1 files 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<byte>& 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<byte> decode(DataSource& pem, + std::string& label); + +/** +* Decode PEM data +* @param label is what we expect the label to be +*/ +BOTAN_DLL SecureVector<byte> 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<byte>&, - const std::string&, size_t = 64); - -BOTAN_DLL SecureVector<byte> decode(DataSource&, std::string&); -BOTAN_DLL SecureVector<byte> 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); } |