Crypto++  5.6.3
Free C++ class library of cryptographic schemes
Classes | Enumerations | Functions
asn.h File Reference

Classes and functions for working with ANS.1 objects. More...

Go to the source code of this file.

Classes

class  UnknownOID
 
class  OID
 Object Identifier. More...
 
class  EncodedObjectFilter
 
class  BERGeneralDecoder
 BER General Decoder. More...
 
class  DERGeneralEncoder
 DER General Encoder. More...
 
class  BERSequenceDecoder
 BER Sequence Decoder. More...
 
class  DERSequenceEncoder
 DER Sequence Encoder. More...
 
class  BERSetDecoder
 BER Set Decoder. More...
 
class  DERSetEncoder
 DER Set Encoder. More...
 
class  ASNOptional< T >
 
class  ASN1CryptoMaterial< BASE >
 _ More...
 
class  X509PublicKey
 encodes/decodes subjectPublicKeyInfo More...
 
class  PKCS8PrivateKey
 encodes/decodes privateKeyInfo More...
 

Enumerations

enum  ASNTag {
  BOOLEAN = 0x01, INTEGER = 0x02, BIT_STRING = 0x03, OCTET_STRING = 0x04,
  TAG_NULL = 0x05, OBJECT_IDENTIFIER = 0x06, OBJECT_DESCRIPTOR = 0x07, EXTERNAL = 0x08,
  REAL = 0x09, ENUMERATED = 0x0a, UTF8_STRING = 0x0c, SEQUENCE = 0x10,
  SET = 0x11, NUMERIC_STRING = 0x12, PRINTABLE_STRING = 0x13, T61_STRING = 0x14,
  VIDEOTEXT_STRING = 0x15, IA5_STRING = 0x16, UTC_TIME = 0x17, GENERALIZED_TIME = 0x18,
  GRAPHIC_STRING = 0x19, VISIBLE_STRING = 0x1a, GENERAL_STRING = 0x1b
}
 
enum  ASNIdFlag {
  UNIVERSAL = 0x00, CONSTRUCTED = 0x20, APPLICATION = 0x40, CONTEXT_SPECIFIC = 0x80,
  PRIVATE = 0xc0
}
 

Functions

void BERDecodeError ()
 
size_t DERLengthEncode (BufferedTransformation &out, lword length)
 DER Length.
 
bool BERLengthDecode (BufferedTransformation &in, size_t &length)
 
void DEREncodeNull (BufferedTransformation &out)
 
void BERDecodeNull (BufferedTransformation &in)
 
size_t DEREncodeOctetString (BufferedTransformation &out, const byte *str, size_t strLen)
 ASN Strings.
 
size_t DEREncodeOctetString (BufferedTransformation &out, const SecByteBlock &str)
 
size_t BERDecodeOctetString (BufferedTransformation &in, SecByteBlock &str)
 
size_t BERDecodeOctetString (BufferedTransformation &in, BufferedTransformation &str)
 
size_t DEREncodeTextString (BufferedTransformation &out, const std::string &str, byte asnTag)
 
size_t BERDecodeTextString (BufferedTransformation &in, std::string &str, byte asnTag)
 
size_t DEREncodeBitString (BufferedTransformation &out, const byte *str, size_t strLen, unsigned int unusedBits=0)
 ASN BitString.
 
size_t BERDecodeBitString (BufferedTransformation &in, SecByteBlock &str, unsigned int &unusedBits)
 
void DERReencode (BufferedTransformation &source, BufferedTransformation &dest)
 
template<class T >
size_t DEREncodeUnsigned (BufferedTransformation &out, T w, byte asnTag=INTEGER)
 DER Encode Unsigned. More...
 
template<class T >
void BERDecodeUnsigned (BufferedTransformation &in, T &w, byte asnTag=INTEGER, T minValue=0, T maxValue=((std::numeric_limits< T >::max)()))
 BER Decode Unsigned.
 
bool operator== (const ::::OID &lhs, const ::::OID &rhs)
 
bool operator!= (const ::::OID &lhs, const ::::OID &rhs)
 
bool operator< (const ::::OID &lhs, const ::::OID &rhs)
 
inline::::OID operator+ (const ::::OID &lhs, unsigned long rhs)
 

Detailed Description

Classes and functions for working with ANS.1 objects.

Definition in file asn.h.

Function Documentation

template<class T >
size_t DEREncodeUnsigned ( BufferedTransformation out,
w,
byte  asnTag = INTEGER 
)

DER Encode Unsigned.

for INTEGER, BOOLEAN, and ENUM

Definition at line 316 of file asn.h.

References DERLengthEncode(), and BufferedTransformation::Put().

Referenced by KDF2_RNG::GenerateBlock(), and PolynomialMod2::IsIrreducible().