libdcp
Public Member Functions | Private Attributes | List of all members
dcp::Key Class Reference

A key for decrypting/encrypting assets. More...

#include <key.h>

Public Member Functions

 Key (int length=ASDCP::KeyLen)
 
 Key (uint8_t const *, int length=ASDCP::KeyLen)
 
 Key (std::string)
 
 Key (Key const &)
 
Keyoperator= (Key const &)
 
uint8_t const * value () const
 
int length () const
 
std::string hex () const
 

Private Attributes

uint8_t * _value = nullptr
 
int _length = 0
 

Detailed Description

A key for decrypting/encrypting assets.

Definition at line 58 of file key.h.

Constructor & Destructor Documentation

◆ Key() [1/3]

Key::Key ( int  length = ASDCP::KeyLen)
explicit

Create a new, random key

Definition at line 55 of file key.cc.

◆ Key() [2/3]

Key::Key ( uint8_t const *  value,
int  length = ASDCP::KeyLen 
)
explicit

Create a Key from a raw key value

Definition at line 64 of file key.cc.

◆ Key() [3/3]

Key::Key ( std::string  value)
explicit

Create a Key from a hex key value

Definition at line 72 of file key.cc.

Member Function Documentation

◆ hex()

string Key::hex ( ) const
Returns
Key value as a hexadecimal string

Definition at line 109 of file key.cc.

◆ value()

uint8_t const* dcp::Key::value ( ) const
inline
Returns
Raw key value

Definition at line 76 of file key.h.

Member Data Documentation

◆ _value

uint8_t* dcp::Key::_value = nullptr
private

Raw key value

Definition at line 89 of file key.h.


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