Use an enum class for Marker.
[libdcp.git] / src / key.h
index c1402c54e71f0e98f28030a3200c36697f8f01b3..690799f3b92ddf5354f88c6d509e50966a105070 100644 (file)
--- a/src/key.h
+++ b/src/key.h
@@ -38,6 +38,7 @@
 #ifndef LIBDCP_KEY_H
 #define LIBDCP_KEY_H
 
+#include <asdcp/AS_DCP.h>
 #include <stdint.h>
 #include <string>
 
@@ -50,30 +51,35 @@ class Key
 {
 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);