summaryrefslogtreecommitdiff
path: root/base64.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-11-05 01:59:46 -0500
committerJeffrey Walton <noloader@gmail.com>2015-11-05 01:59:46 -0500
commit48809d4e85c125814425c621d8d0d89f95405924 (patch)
tree1010fd16c4b1199f3d27dd726dda241a2bd29f83 /base64.h
parent025337a94aceb75d188149db70c2094673772816 (diff)
downloadcryptopp-git-48809d4e85c125814425c621d8d0d89f95405924.tar.gz
CRYPTOPP 5.6.3 RC6 checkin
Diffstat (limited to 'base64.h')
-rw-r--r--base64.h147
1 files changed, 82 insertions, 65 deletions
diff --git a/base64.h b/base64.h
index 428b62cd..5b3f02db 100644
--- a/base64.h
+++ b/base64.h
@@ -1,65 +1,82 @@
-#ifndef CRYPTOPP_BASE64_H
-#define CRYPTOPP_BASE64_H
-
-#include "basecode.h"
-
-NAMESPACE_BEGIN(CryptoPP)
-
-//! Base64 Encoder Class
-// https://tools.ietf.org/html/rfc4648#section-4
-class Base64Encoder : public SimpleProxyFilter
-{
-public:
- Base64Encoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = true, int maxLineLength = 72)
- : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
- {
- IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength));
- }
-
- void IsolatedInitialize(const NameValuePairs &parameters);
-};
-
-//! Base64 Decoder Class
-// https://tools.ietf.org/html/rfc4648#section-4
-class Base64Decoder : public BaseN_Decoder
-{
-public:
- Base64Decoder(BufferedTransformation *attachment = NULL)
- : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
-
- void IsolatedInitialize(const NameValuePairs &parameters) {}
-
-private:
- static const int * CRYPTOPP_API GetDecodingLookupArray();
-};
-
-//! Base64 URL Encoder Class
-// https://tools.ietf.org/html/rfc4648#section-5
-class Base64URLEncoder : public SimpleProxyFilter
-{
-public:
- Base64URLEncoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = false, int maxLineLength = -1)
- : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
- {
- IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength));
- }
-
- void IsolatedInitialize(const NameValuePairs &parameters);
-};
-
-//! Base64 URL Decoder Class
-class Base64URLDecoder : public BaseN_Decoder
-{
-public:
- Base64URLDecoder(BufferedTransformation *attachment = NULL)
- : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
-
- void IsolatedInitialize(const NameValuePairs &parameters) {}
-
-private:
- static const int * CRYPTOPP_API GetDecodingLookupArray();
-};
-
-NAMESPACE_END
-
-#endif
+// .h - written and placed in the public domain by Wei Dai
+
+//! \file
+//! \brief Class files for the Base64Encoder, Base64Decoder, Base64URLEncoder and Base64URLDecoder
+
+#ifndef CRYPTOPP_BASE64_H
+#define CRYPTOPP_BASE64_H
+
+#include "cryptlib.h"
+#include "basecode.h"
+
+NAMESPACE_BEGIN(CryptoPP)
+
+//! \class Base64Encoder
+//! \brief Base64 encodes data
+//! \details Base64 encodes data per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-4)
+//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter.
+class Base64Encoder : public SimpleProxyFilter
+{
+public:
+ Base64Encoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = true, int maxLineLength = 72)
+ : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
+ {
+ IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength));
+ }
+
+ void IsolatedInitialize(const NameValuePairs &parameters);
+};
+
+//! \class Base64Decoder
+//! \brief Base64 decodes data
+//! \details Base64 decodes data per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-4)
+//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter.
+class Base64Decoder : public BaseN_Decoder
+{
+public:
+ Base64Decoder(BufferedTransformation *attachment = NULL)
+ : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
+
+ void IsolatedInitialize(const NameValuePairs &parameters)
+ {CRYPTOPP_UNUSED(parameters);}
+
+private:
+ static const int * CRYPTOPP_API GetDecodingLookupArray();
+};
+
+//! \class Base64URLEncoder
+//! \brief Base64 encodes data using a web safe alphabet
+//! \details Base64 encodes data using a web safe alphabet per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-5)
+//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter.
+class Base64URLEncoder : public SimpleProxyFilter
+{
+public:
+ Base64URLEncoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = false, int maxLineLength = -1)
+ : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
+ {
+ IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength));
+ }
+
+ void IsolatedInitialize(const NameValuePairs &parameters);
+};
+
+//! \class Base64URLDecoder
+//! \brief Base64 decodes data using a web safe alphabet
+//! \details Base64 decodes data using a web safe alphabet per RFC 4648 (http://tools.ietf.org/html/rfc4648#section-5)
+//! \details To specify alternative alpahabet or code, call Initialize() with EncodingLookupArray parameter.
+class Base64URLDecoder : public BaseN_Decoder
+{
+public:
+ Base64URLDecoder(BufferedTransformation *attachment = NULL)
+ : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
+
+ void IsolatedInitialize(const NameValuePairs &parameters)
+ {CRYPTOPP_UNUSED(parameters);}
+
+private:
+ static const int * CRYPTOPP_API GetDecodingLookupArray();
+};
+
+NAMESPACE_END
+
+#endif