#ifndef LIBDCP_KEY_H
#define LIBDCP_KEY_H
+#include <asdcp/AS_DCP.h>
#include <stdint.h>
#include <string>
{
public:
/** Create a new, random key */
- Key ();
+ explicit Key (int length = ASDCP::KeyLen);
/** Create a Key from a raw key value */
- explicit Key (uint8_t const *);
+ explicit Key (uint8_t const *, int length = ASDCP::KeyLen);
/** Create a Key from a hex key value */
explicit Key (std::string);
Key (Key const &);
- ~Key ();
-
Key& operator= (Key const &);
+ ~Key ();
+
/** @return Raw key value */
uint8_t const * value () const {
return _value;
}
+ int length () const {
+ return _length;
+ }
+
/** @return Key value as a hexadecimal string */
std::string hex () const;
private:
/** Raw key value */
uint8_t* _value;
+ int _length;
};
extern bool operator== (Key const & a, Key const & b);