+#endif
+
+ cxml::NodePtr decryption = f.optional_node_child ("Decryption");
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+ if (decryption && decryption->node_children().size() == 1) {
+ /* The content of <Decryption> is a path to a file; if it's relative, it's in the same
+ directory as .config. */
+ _decryption_chain_path = decryption->content();
+ if (_decryption_chain_path.is_relative()) {
+ _decryption_chain = read_swaroop_chain (path(_decryption_chain_path.string()));
+ } else {
+ _decryption_chain = read_swaroop_chain (_decryption_chain_path);
+ }
+ } else {
+ /* <Decryption> is not present or has more children: ignore it and remake. */
+ _decryption_chain = create_certificate_chain ();
+ }
+#else
+ if (decryption) {
+ shared_ptr<dcp::CertificateChain> c (new dcp::CertificateChain ());
+ BOOST_FOREACH (cxml::NodePtr i, decryption->node_children ("Certificate")) {
+ c->add (dcp::Certificate (i->content ()));
+ }
+ c->set_key (decryption->string_child ("PrivateKey"));
+ _decryption_chain = c;
+ } else {
+ _decryption_chain = create_certificate_chain ();
+ }
+#endif