Updated documentation

pull/157/head
Jeffrey Walton 2016-04-20 19:03:46 -04:00
parent 50881b3fb3
commit f4d8b054b3
3 changed files with 31 additions and 30 deletions

52
asn.h
View File

@ -74,85 +74,85 @@ public:
// unsigned int DERLengthEncode(unsigned int length, byte *output=0); // unsigned int DERLengthEncode(unsigned int length, byte *output=0);
//! \brief DER encode a length //! \brief DER encode a length
//! \param out BufferedTransformation object //! \param bt BufferedTransformation object for writing
//! \param length the size to encode //! \param length the size to encode
//! \returns the number of octets used for the encoding //! \returns the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API DERLengthEncode(BufferedTransformation &out, lword length); CRYPTOPP_DLL size_t CRYPTOPP_API DERLengthEncode(BufferedTransformation &bt, lword length);
//! \brief BER decode a length //! \brief BER decode a length
//! \param in BufferedTransformation object //! \param bt BufferedTransformation object for reading
//! \param length the decoded size //! \param length the decoded size
//! \returns true if the value was decoded //! \returns true if the value was decoded
//! \throws BERDecodeError if the value fails to decode or is too large for size_t //! \throws BERDecodeError if the value fails to decode or is too large for size_t
//! \details BERLengthDecode() returns false if the encoding is indefinite length. //! \details BERLengthDecode() returns false if the encoding is indefinite length.
CRYPTOPP_DLL bool CRYPTOPP_API BERLengthDecode(BufferedTransformation &in, size_t &length); CRYPTOPP_DLL bool CRYPTOPP_API BERLengthDecode(BufferedTransformation &bt, size_t &length);
//! \brief DER encode NULL //! \brief DER encode NULL
//! \param out BufferedTransformation object //! \param bt BufferedTransformation object for writing
CRYPTOPP_DLL void CRYPTOPP_API DEREncodeNull(BufferedTransformation &out); CRYPTOPP_DLL void CRYPTOPP_API DEREncodeNull(BufferedTransformation &bt);
//! \brief BER decode NULL //! \brief BER decode NULL
//! \param in BufferedTransformation object //! \param bt BufferedTransformation object for reading
CRYPTOPP_DLL void CRYPTOPP_API BERDecodeNull(BufferedTransformation &in); CRYPTOPP_DLL void CRYPTOPP_API BERDecodeNull(BufferedTransformation &bt);
//! \brief DER encode octet string //! \brief DER encode octet string
//! \param out BufferedTransformation object //! \param bt BufferedTransformation object for writing
//! \param str the string to encode //! \param str the string to encode
//! \param strLen the length of the string //! \param strLen the length of the string
//! \returns the number of octets used for the encoding //! \returns the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeOctetString(BufferedTransformation &out, const byte *str, size_t strLen); CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeOctetString(BufferedTransformation &bt, const byte *str, size_t strLen);
//! \brief DER encode octet string //! \brief DER encode octet string
//! \param out BufferedTransformation object //! \param bt BufferedTransformation object for reading
//! \param str the string to encode //! \param str the string to encode
//! \returns the number of octets used for the encoding //! \returns the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeOctetString(BufferedTransformation &out, const SecByteBlock &str); CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeOctetString(BufferedTransformation &bt, const SecByteBlock &str);
//! \brief BER decode octet string //! \brief BER decode octet string
//! \param in BufferedTransformation object //! \param bt BufferedTransformation object for reading
//! \param str the decoded string //! \param str the decoded string
//! \returns the number of octets used for the encoding //! \returns the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeOctetString(BufferedTransformation &in, SecByteBlock &str); CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeOctetString(BufferedTransformation &bt, SecByteBlock &str);
//! \brief BER decode octet string //! \brief BER decode octet string
//! \param in BufferedTransformation object //! \param bt BufferedTransformation object for reading
//! \param str the decoded string //! \param str the decoded string
//! \returns the number of octets used for the encoding //! \returns the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeOctetString(BufferedTransformation &in, BufferedTransformation &str); CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeOctetString(BufferedTransformation &bt, BufferedTransformation &str);
//! \brief DER encode text string //! \brief DER encode text string
//! \param out BufferedTransformation object //! \param bt BufferedTransformation object for writing
//! \param str the string to encode //! \param str the string to encode
//! \param asnTag the ASN.1 type //! \param asnTag the ASN.1 type
//! \returns the number of octets used for the encoding //! \returns the number of octets used for the encoding
//! \details DEREncodeTextString() can be used for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING //! \details DEREncodeTextString() can be used for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeTextString(BufferedTransformation &out, const std::string &str, byte asnTag); CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeTextString(BufferedTransformation &bt, const std::string &str, byte asnTag);
//! \brief BER decode text string //! \brief BER decode text string
//! \param in BufferedTransformation object //! \param bt BufferedTransformation object for reading
//! \param str the string to encode //! \param str the string to encode
//! \param asnTag the ASN.1 type //! \param asnTag the ASN.1 type
//! \details DEREncodeTextString() can be used for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING //! \details DEREncodeTextString() can be used for UTF8_STRING, PRINTABLE_STRING, and IA5_STRING
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeTextString(BufferedTransformation &in, std::string &str, byte asnTag); CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte asnTag);
//! \brief DER encode bit string //! \brief DER encode bit string
//! \param out BufferedTransformation object //! \param bt BufferedTransformation object for writing
//! \param str the string to encode //! \param str the string to encode
//! \param strLen the length of the string //! \param strLen the length of the string
//! \param unusedBits the number of unused bits //! \param unusedBits the number of unused bits
//! \returns the number of octets used for the encoding //! \returns the number of octets used for the encoding
CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeBitString(BufferedTransformation &out, const byte *str, size_t strLen, unsigned int unusedBits=0); CRYPTOPP_DLL size_t CRYPTOPP_API DEREncodeBitString(BufferedTransformation &bt, const byte *str, size_t strLen, unsigned int unusedBits=0);
//! \brief DER decode bit string //! \brief DER decode bit string
//! \param in BufferedTransformation object //! \param bt BufferedTransformation object for reading
//! \param str the decoded string //! \param str the decoded string
//! \param unusedBits the number of unused bits //! \param unusedBits the number of unused bits
CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeBitString(BufferedTransformation &in, SecByteBlock &str, unsigned int &unusedBits); CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodeBitString(BufferedTransformation &bt, SecByteBlock &str, unsigned int &unusedBits);
//! \brief BER decode and DER re-encode //! \brief BER decode and DER re-encode
//! \param source BufferedTransformation object //! \param bt BufferedTransformation object for writing
//! \param dest BufferedTransformation object //! \param dest BufferedTransformation object
CRYPTOPP_DLL void CRYPTOPP_API DERReencode(BufferedTransformation &source, BufferedTransformation &dest); CRYPTOPP_DLL void CRYPTOPP_API DERReencode(BufferedTransformation &bt, BufferedTransformation &dest);
//! \brief Object Identifier //! \brief Object Identifier
class CRYPTOPP_DLL OID class CRYPTOPP_DLL OID

View File

@ -271,6 +271,7 @@ public:
//! \brief Construct a BLAKE2b hash //! \brief Construct a BLAKE2b hash
//! \param digestSize the digest size, in bytes //! \param digestSize the digest size, in bytes
//! \param treeMode flag indicating tree mode
BLAKE2b(bool treeMode=false, unsigned int digestSize = DIGESTSIZE) : ThisBase(treeMode, digestSize) {} BLAKE2b(bool treeMode=false, unsigned int digestSize = DIGESTSIZE) : ThisBase(treeMode, digestSize) {}
//! \brief Construct a BLAKE2b hash //! \brief Construct a BLAKE2b hash
@ -305,6 +306,7 @@ public:
//! \brief Construct a BLAKE2b hash //! \brief Construct a BLAKE2b hash
//! \param digestSize the digest size, in bytes //! \param digestSize the digest size, in bytes
//! \param treeMode flag indicating tree mode
BLAKE2s(bool treeMode=false, unsigned int digestSize = DIGESTSIZE) : ThisBase(treeMode, digestSize) {} BLAKE2s(bool treeMode=false, unsigned int digestSize = DIGESTSIZE) : ThisBase(treeMode, digestSize) {}
//! \brief Construct a BLAKE2b hash //! \brief Construct a BLAKE2b hash
@ -325,4 +327,3 @@ public:
NAMESPACE_END NAMESPACE_END
#endif #endif

6
hex.h
View File

@ -19,13 +19,13 @@ public:
//! \brief Construct a HexEncoder //! \brief Construct a HexEncoder
//! \param attachment a BufferedTrasformation to attach to this object //! \param attachment a BufferedTrasformation to attach to this object
//! \param uppercase a flag indicating uppercase output //! \param uppercase a flag indicating uppercase output
//! \param groupSize the size of the grouping //! \param groupSize the size of the output grouping
//! \param separator the separator to use between groups //! \param separator the separator to use between groups
//! \param terminator the terminator append after processing //! \param terminator the terminator append after processing
HexEncoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int outputGroupSize = 0, const std::string &separator = ":", const std::string &terminator = "") HexEncoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
: SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
{ {
IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), outputGroupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator))); IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
} }
void IsolatedInitialize(const NameValuePairs &parameters); void IsolatedInitialize(const NameValuePairs &parameters);