diff options
Diffstat (limited to 'src/codec/pem/pem.h')
-rw-r--r-- | src/codec/pem/pem.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/codec/pem/pem.h b/src/codec/pem/pem.h index 10267f029..6c33c642d 100644 --- a/src/codec/pem/pem.h +++ b/src/codec/pem/pem.h @@ -17,37 +17,50 @@ namespace PEM_Code { /** * Encode some binary data in PEM format */ -BOTAN_DLL std::string encode(const byte der[], - size_t der_len, +BOTAN_DLL std::string encode(const byte data[], + size_t data_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); +inline std::string encode(const std::vector<byte>& data, + const std::string& label, + size_t line_width = 64) + { + return encode(&data[0], data.size(), label, line_width); + } + +/** +* Encode some binary data in PEM format +*/ +inline std::string encode(const secure_vector<byte>& data, + const std::string& label, + size_t line_width = 64) + { + return encode(&data[0], data.size(), label, line_width); + } /** * Decode PEM data * @param label is set to the PEM label found for later inspection */ -BOTAN_DLL SecureVector<byte> decode(DataSource& pem, +BOTAN_DLL secure_vector<byte> decode(DataSource& pem, std::string& label); /** * Decode PEM data * @param label is set to the PEM label found for later inspection */ -BOTAN_DLL SecureVector<byte> decode(const std::string& pem, +BOTAN_DLL secure_vector<byte> decode(const std::string& pem, std::string& label); /** * Decode PEM data * @param label is what we expect the label to be */ -BOTAN_DLL SecureVector<byte> decode_check_label( +BOTAN_DLL secure_vector<byte> decode_check_label( DataSource& pem, const std::string& label); @@ -55,7 +68,7 @@ BOTAN_DLL SecureVector<byte> decode_check_label( * Decode PEM data * @param label is what we expect the label to be */ -BOTAN_DLL SecureVector<byte> decode_check_label( +BOTAN_DLL secure_vector<byte> decode_check_label( const std::string& pem, const std::string& label); |