summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-04 22:33:03 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-04 22:33:03 +0100
commit4e2d5cca82d19246bd1ebf24bc9e2bf436232f83 (patch)
tree36ee0cc32755fafd34cb0bbf168552b6b5d62459
parent5de76e0ad3c6fc6e388350f3f046ea5e66f03baf (diff)
Add method to return a base-64 version of a whole CertificateChain.
-rw-r--r--src/certificate_chain.cc13
-rw-r--r--src/certificate_chain.h4
2 files changed, 15 insertions, 2 deletions
diff --git a/src/certificate_chain.cc b/src/certificate_chain.cc
index 2ba70183..0cf9ee06 100644
--- a/src/certificate_chain.cc
+++ b/src/certificate_chain.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
@@ -562,3 +562,14 @@ CertificateChain::add_signature_value (xmlpp::Node* parent, string ns) const
xmlSecDSigCtxDestroy (signature_context);
}
+
+string
+CertificateChain::chain () const
+{
+ string o;
+ BOOST_FOREACH (Certificate const &i, root_to_leaf ()) {
+ o += i.certificate(true);
+ }
+
+ return o;
+}
diff --git a/src/certificate_chain.h b/src/certificate_chain.h
index 3a925373..ca259c08 100644
--- a/src/certificate_chain.h
+++ b/src/certificate_chain.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
@@ -100,6 +100,8 @@ public:
_key = k;
}
+ std::string chain () const;
+
private:
friend class ::certificates;