From 057a5d5d435d53166d1b8751748a9ba0a317bee3 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 29 Apr 2016 10:07:03 +0300 Subject: Add signature_manifest class --- bpkg/manifest | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'bpkg/manifest') diff --git a/bpkg/manifest b/bpkg/manifest index d55e714..0c9362f 100644 --- a/bpkg/manifest +++ b/bpkg/manifest @@ -588,6 +588,39 @@ namespace bpkg void serialize (manifest_serializer&) const; }; + + class signature_manifest + { + public: + // Checksum of the corresponding package_manifests. + // + std::string sha256sum; + + // Signature of the corresponding package_manifests. Calculated by + // encrypting package_manifests checksum (stored in sha256sum) with the + // repository certificate private key. + // + std::vector signature; + + public: + signature_manifest () = default; + signature_manifest (manifest_parser&, bool ignore_unknown = false); + + // Serialize sha256sum and base64-encoded representation of the signature. + // + void + serialize (manifest_serializer&) const; + + private: + // Used for delegating in public constructor. Strictly speaking is not + // required, as a signature_manifest currently never appears as a part of + // a manifest list, but kept for the consistency with other manifests + // implementations. + // + signature_manifest (manifest_parser&, + manifest_name_value start, + bool ignore_unknown); + }; } #endif // BPKG_MANIFEST -- cgit v1.1