Security Scol plugin
base64.h
Go to the documentation of this file.
1// base64.h - originally written and placed in the public domain by Wei Dai
2
5
6#ifndef CRYPTOPP_BASE64_H
7#define CRYPTOPP_BASE64_H
8
9#include "cryptlib.h"
10#include "basecode.h"
11
12NAMESPACE_BEGIN(CryptoPP)
13
14
17{
18public:
26 Base64Encoder(BufferedTransformation *attachment = NULLPTR, bool insertLineBreaks = true, int maxLineLength = 72)
27 : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
28 {
29 IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength));
30 }
31
52 void IsolatedInitialize(const NameValuePairs &parameters);
53};
54
58{
59public:
64 : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
65
83 void IsolatedInitialize(const NameValuePairs &parameters);
84
85private:
88 static const int * CRYPTOPP_API GetDecodingLookupArray();
89};
90
95{
96public:
109 Base64URLEncoder(BufferedTransformation *attachment = NULLPTR, bool insertLineBreaks = false, int maxLineLength = -1)
110 : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
111 {
112 CRYPTOPP_UNUSED(insertLineBreaks), CRYPTOPP_UNUSED(maxLineLength);
113 IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), false)(Name::MaxLineLength(), -1)(Name::Pad(),false));
114 }
115
125 void IsolatedInitialize(const NameValuePairs &parameters);
126};
127
132{
133public:
139 : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
140
148 void IsolatedInitialize(const NameValuePairs &parameters);
149
150private:
153 static const int * CRYPTOPP_API GetDecodingLookupArray();
154};
155
156NAMESPACE_END
157
158#endif
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
Definition algparam.h:508
Base classes for working with encoders and decoders.
Base64 decodes data using DUDE.
Definition base64.h:58
Base64Decoder(BufferedTransformation *attachment=NULLPTR)
Construct a Base64Decoder.
Definition base64.h:63
void IsolatedInitialize(const NameValuePairs &parameters)
Initialize or reinitialize this object, without signal propagation.
Definition base64.cpp:86
Base64 encodes data using DUDE.
Definition base64.h:17
Base64Encoder(BufferedTransformation *attachment=NULLPTR, bool insertLineBreaks=true, int maxLineLength=72)
Construct a Base64Encoder.
Definition base64.h:26
Base64 decodes data using a web safe alphabet.
Definition base64.h:132
void IsolatedInitialize(const NameValuePairs &parameters)
Initialize or reinitialize this object, without signal propagation.
Definition base64.cpp:98
Base64URLDecoder(BufferedTransformation *attachment=NULLPTR)
Construct a Base64URLDecoder.
Definition base64.h:138
Base64 encodes data using a web safe alphabet.
Definition base64.h:95
void IsolatedInitialize(const NameValuePairs &parameters)
Definition base64.cpp:69
Base64URLEncoder(BufferedTransformation *attachment=NULLPTR, bool insertLineBreaks=false, int maxLineLength=-1)
Construct a Base64URLEncoder.
Definition base64.h:109
Decoder for bases that are a power of 2.
Definition basecode.h:59
Encoder for bases that are a power of 2.
Definition basecode.h:18
Interface for buffered transformations.
Definition cryptlib.h:1652
Filter that breaks input stream into groups of fixed size.
Definition basecode.h:113
Interface for retrieving values given their names.
Definition cryptlib.h:322
Proxy filter that doesn't modify the underlying filter's input or output.
Definition filters.h:1065
Abstract base classes that provide a uniform interface to this library.