#include <magick/version.h>
#include <libdcp/version.h>
#include <libdcp/util.h>
+#include <libdcp/signer_chain.h>
+#include <libdcp/signer.h>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include "config.h"
#include "ratio.h"
#include "job.h"
+#include "cross.h"
#ifdef DCPOMATIC_WINDOWS
#include "stack.hpp"
#endif
#endif
avfilter_register_all ();
+
+ libdcp::init ();
Ratio::setup_ratios ();
DCPContentType::setup_dcp_content_types ();
return (ext == ".tif" || ext == ".tiff" || ext == ".jpg" || ext == ".jpeg" || ext == ".png" || ext == ".bmp" || ext == ".tga");
}
+string
+tidy_for_filename (string f)
+{
+ string t;
+ for (size_t i = 0; i < f.length(); ++i) {
+ if (isalnum (f[i]) || f[i] == '_' || f[i] == '-') {
+ t += f[i];
+ } else {
+ t += '_';
+ }
+ }
+
+ return t;
+}
+
+shared_ptr<const libdcp::Signer>
+make_signer ()
+{
+ boost::filesystem::path const sd = Config::instance()->signer_chain_directory ();
+ if (boost::filesystem::is_empty (sd)) {
+ libdcp::make_signer_chain (sd, openssl_path ());
+ }
+
+ libdcp::CertificateChain chain;
+
+ {
+ boost::filesystem::path p (sd);
+ p /= "ca.self-signed.pem";
+ chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (p)));
+ }
+
+ {
+ boost::filesystem::path p (sd);
+ p /= "intermediate.signed.pem";
+ chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (p)));
+ }
+
+ {
+ boost::filesystem::path p (sd);
+ p /= "leaf.signed.pem";
+ chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (p)));
+ }
+
+ boost::filesystem::path signer_key (sd);
+ signer_key /= "leaf.key";
+
+ return shared_ptr<const libdcp::Signer> (new libdcp::Signer (chain, signer_key));
+}
+