ndn::security::v2::ValidationError Class Reference

Validation error code and optional detailed error message. More...

#include <ndn-cxx/security/validation-error.hpp>

Public Types

enum  Code : uint32_t {
  NO_ERROR = 0 ,
  INVALID_SIGNATURE = 1 ,
  MALFORMED_SIGNATURE = 2 ,
  CANNOT_RETRIEVE_CERT = 3 ,
  EXPIRED_CERT = 4 ,
  LOOP_DETECTED = 5 ,
  MALFORMED_CERT = 6 ,
  EXCEEDED_DEPTH_LIMIT = 7 ,
  INVALID_KEY_LOCATOR = 8 ,
  POLICY_ERROR = 9 ,
  IMPLEMENTATION_ERROR = 255 ,
  USER_MIN = 256
}
 Known error codes that can be returned by the Validator interface. More...
 

Public Member Functions

 ValidationError (uint32_t code, const std::string &info="")
 ValidationError is implicitly constructible from an integer error code and an optional info string. More...
 
Code getCode () const
 
const std::string & getInfo () const
 

Friends

std::ostream & operator<< (std::ostream &os, const ValidationError &err)
 

Detailed Description

Validation error code and optional detailed error message.

Definition at line 34 of file validation-error.hpp.

Member Enumeration Documentation

◆ Code

Known error codes that can be returned by the Validator interface.

Additional error codes can be defined by validation policies implemented outside ndn-cxx.

Enumerator
NO_ERROR 

No error.

INVALID_SIGNATURE 

Signature verification failed.

MALFORMED_SIGNATURE 

The signature (e.g., SignatureInfo element) is missing or malformed.

CANNOT_RETRIEVE_CERT 

The certificate cannot be retrieved.

EXPIRED_CERT 

The certificate expired or is not yet valid.

LOOP_DETECTED 

Loop detected in the certification chain.

MALFORMED_CERT 

The certificate is malformed.

EXCEEDED_DEPTH_LIMIT 

Exceeded validation depth limit.

INVALID_KEY_LOCATOR 

The KeyLocator element is missing or has an invalid format.

POLICY_ERROR 

The packet violates the validation rules enforced by the policy.

IMPLEMENTATION_ERROR 

Internal implementation error.

USER_MIN 

Third-party validator implementations can use error codes greater than or equal to this value to indicate a custom or specialized error condition.

Definition at line 42 of file validation-error.hpp.

Constructor & Destructor Documentation

◆ ValidationError()

ndn::security::v2::ValidationError::ValidationError ( uint32_t  code,
const std::string &  info = "" 
)
inline

ValidationError is implicitly constructible from an integer error code and an optional info string.

Definition at line 74 of file validation-error.hpp.

Member Function Documentation

◆ getCode()

Code ndn::security::v2::ValidationError::getCode ( ) const
inline

Definition at line 81 of file validation-error.hpp.

◆ getInfo()

const std::string& ndn::security::v2::ValidationError::getInfo ( ) const
inline

Definition at line 87 of file validation-error.hpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ValidationError err 
)
friend

Definition at line 97 of file validation-error.hpp.