Crypto++ 8.1 Free C++ class library of cryptographic schemes

Public Member Functions | Friends | List of all members
OID Class Reference

Object Identifier. More...

## Public Member Functions
| OID ()
| Construct an OID.
| OID (word32 v)
| Construct an OID. More...
| OID (BufferedTransformation &bt)
| Construct an OID. More...
OID & | operator+= (word32 rhs)
| Append a value to an OID. More...
void | DEREncode (BufferedTransformation &bt) const
| DER encode this OID. More...
void | BERDecode (BufferedTransformation &bt)
| BER decode an OID. More...
void | BERDecodeAndCheck (BufferedTransformation &bt) const
| BER decode an OID. More...
bool | Empty () const
const std::vector< word32 > & | GetValues () const

## Friends
bool | operator== (const OID &lhs, const OID &rhs)
| Compare two OIDs for equality. More...
bool | operator!= (const OID &lhs, const OID &rhs)
| Compare two OIDs for inequality. More...
bool | operator< (const OID &lhs, const OID &rhs)
| Compare two OIDs for ordering. More...

## Detailed Description

Object Identifier.

Definition at line 166 of file asn.h.

## Constructor & Destructor Documentation

## ◆ OID() [1/2]

OID::OID | ( | word32 | v | ) |
| inline

Construct an OID.

Parameters

  v | value to initialize the OID

Definition at line 175 of file asn.h.

## ◆ OID() [2/2]

OID::OID | ( | BufferedTransformation & | bt | ) |
| inline

Construct an OID.

Parameters

  bt | BufferedTransformation object

Definition at line 178 of file asn.h.

## Member Function Documentation

## ◆ operator+=()

OID& OID::operator+= | ( | word32 | rhs | ) |
| inline

Append a value to an OID.

Parameters

  rhs | the value to append

Definition at line 182 of file asn.h.

## ◆ DEREncode()

void OID::DEREncode | ( | BufferedTransformation & | bt | ) | const

DER encode this OID.

Parameters

  bt | BufferedTransformation object

Definition at line 259 of file asn.cpp.

## ◆ BERDecode()

void OID::BERDecode | ( | BufferedTransformation & | bt | ) |

BER decode an OID.

Parameters

  bt | BufferedTransformation object

Definition at line 271 of file asn.cpp.

## ◆ BERDecodeAndCheck()

void OID::BERDecodeAndCheck | ( | BufferedTransformation & | bt | ) | const

BER decode an OID.

Parameters

  bt | BufferedTransformation object

Exceptions

  BERDecodeErr() | if decoded value doesn't match an expected OID

BERDecodeAndCheck() can be used to parse an OID and verify it matches an expected.

      BERSequenceDecoder key(bt);
      ...
      BERSequenceDecoder algorithm(key);
      GetAlgorithmID().BERDecodeAndCheck(algorithm);

Definition at line 300 of file asn.cpp.

## Friends And Related Function Documentation

## ◆ operator==

bool operator== | ( | const OID & | lhs,
|  | const OID & | rhs
| ) |  |
| friend

Compare two OIDs for equality.

Parameters

  lhs | the first OID
  rhs | the second OID

Returns
  true if the OIDs are equal, false otherwise

## ◆ operator!=

bool operator!= | ( | const OID & | lhs,
|  | const OID & | rhs
| ) |  |
| friend

Compare two OIDs for inequality.

Parameters

  lhs | the first OID
  rhs | the second OID

Returns
  true if the OIDs are not equal, false otherwise

## ◆ operator<

bool operator< | ( | const OID & | lhs,
|  | const OID & | rhs
| ) |  |
| friend

Compare two OIDs for ordering.

Parameters

  lhs | the first OID
  rhs | the second OID

Returns
  true if the first OID is less than the second OID, false otherwise

operator<() calls std::lexicographical_compare() on each element in the array of values.

The documentation for this class was generated from the following files:

- asn.h
- asn.cpp