libcdoc 0.1.8
libcdoc Namespace Reference

Classes

class  CDocReader
 Provides decryption interface. More...
 
class  CDocWriter
 Provides encryption interface. More...
 
struct  Configuration
 A configuration provider. More...
 
struct  CryptoBackend
 An authentication provider. More...
 
struct  DataConsumer
 The DataConsumer class. More...
 
struct  DataSource
 The DataSource class. More...
 
struct  FileInfo
 A simple container of file name and size. More...
 
struct  FileListConsumer
 
struct  FileListSource
 
struct  IStreamSource
 
struct  JSONConfiguration
 A Configuration object implementation that reads values from JSON file. More...
 
struct  Lock
 A descriptor of decryption scheme in container. More...
 
struct  MultiDataConsumer
 An abstract base class for multi-stream consumers. More...
 
struct  MultiDataSource
 An abstract base class for multi-stream sources. More...
 
struct  NetworkBackend
 
struct  OStreamConsumer
 
struct  PKCS11Backend
 A convenience class for PKCS11 based cryptographic operations. More...
 
struct  Recipient
 A descriptor of encryption method and key to be used in container. More...
 
struct  VectorConsumer
 
struct  VectorSource
 
struct  WinBackend
 A convenience class for Windows NCrypt cryptographic operations. More...
 

Typedefs

using result_t = int64_t
 A typedef that indicates that integer value may contain libcdoc result code.
 

Enumerations

enum  {
  OK = 0 , END_OF_STREAM = 1 , NOT_IMPLEMENTED = -100 , NOT_SUPPORTED = -101 ,
  WRONG_ARGUMENTS = -102 , WORKFLOW_ERROR = -103 , IO_ERROR = -104 , OUTPUT_ERROR = -105 ,
  OUTPUT_STREAM_ERROR = -106 , INPUT_ERROR = -107 , INPUT_STREAM_ERROR = -108 , WRONG_KEY = -109 ,
  DATA_FORMAT_ERROR = -110 , CRYPTO_ERROR = -111 , ZLIB_ERROR = -112 , PKCS11_ERROR = -113 ,
  HASH_MISMATCH = -114 , CONFIGURATION_ERROR = -115 , NOT_FOUND = -116 , UNSPECIFIED_ERROR = -199
}
 
enum  LogLevel : uint8_t {
  LEVEL_FATAL , LEVEL_ERROR , LEVEL_WARNING , LEVEL_INFO ,
  LEVEL_DEBUG , LEVEL_TRACE
}
 Log-level enumeration to indicate severity of the log message. More...
 

Functions

CDOC_EXPORT std::string getErrorStr (int64_t code)
 
CDOC_EXPORT std::string getVersion ()
 
CDOC_EXPORT void setLogger (Logger *logger)
 
CDOC_EXPORT void setLogLevel (LogLevel level)
 
CDOC_EXPORT void log (LogLevel level, std::string_view file, int line, std::string_view msg)
 

Typedef Documentation

◆ result_t

using libcdoc::result_t = typedef int64_t

A typedef that indicates that integer value may contain libcdoc result code.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OK 

Operation completed successfully.

END_OF_STREAM 

No more input data.

A pseudo-error that indicates that there are no more streams in MultiDataSource

NOT_IMPLEMENTED 

A method is not implemented.

NOT_SUPPORTED 

An operation is not supported.

WRONG_ARGUMENTS 

Conflicting or invalid arguments for a method.

This does not set CDocReader/CDocWriter into error state - so invoking subsequent methods with correct arguments will succeed

WORKFLOW_ERROR 

Components of multi-method workflow are called in wrong order.

This does not set CDocReader/CDocWriter into error state - so invoking subsequent methods in correct order will succeed

IO_ERROR 

A generic input/output error.

OUTPUT_ERROR 

A generic output error.

OUTPUT_STREAM_ERROR 

An error while writing output stream.

INPUT_ERROR 

A generic input error.

INPUT_STREAM_ERROR 

An error while reading input stream.

WRONG_KEY 

The supplied decryption key is wrong.

This does not set CDocReader/CDocWriter into error state - so invoking subsequent methods with correct key will succeed

DATA_FORMAT_ERROR 

Data format of a file (or sub-object inside a file) is wrong.

CRYPTO_ERROR 

Generic error in cryptography subsystem.

ZLIB_ERROR 

Comppression/decompression error in zlib.

PKCS11_ERROR 

Generic error in PKCS11 subsystem.

HASH_MISMATCH 

The value of cryptographic hash is not correct.

CONFIGURATION_ERROR 

Generic error in configuration susbsytem.

NOT_FOUND 

Object not found.

UNSPECIFIED_ERROR 

Unspecified error.

◆ LogLevel

enum libcdoc::LogLevel : uint8_t

Log-level enumeration to indicate severity of the log message.

Enumerator
LEVEL_FATAL 

Most critical level. Application is about to abort.

LEVEL_ERROR 

Errors where functionality has failed or an exception have been caught.

LEVEL_WARNING 

Warnings about validation issues or temporary failures that can be recovered.

LEVEL_INFO 

Information that highlights progress or application lifetime events.

LEVEL_DEBUG 

Debugging the application behavior from internal events of interest.

LEVEL_TRACE 

Most verbose level. Used for development, NOP in production code.

Function Documentation

◆ getErrorStr()

CDOC_EXPORT std::string libcdoc::getErrorStr ( int64_t  code)

◆ getVersion()

CDOC_EXPORT std::string libcdoc::getVersion ( )

◆ log()

CDOC_EXPORT void libcdoc::log ( LogLevel  level,
std::string_view  file,
int  line,
std::string_view  msg 
)

◆ setLogger()

CDOC_EXPORT void libcdoc::setLogger ( Logger *  logger)

◆ setLogLevel()

CDOC_EXPORT void libcdoc::setLogLevel ( LogLevel  level)