diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-04-29 10:07:03 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2016-05-04 20:37:44 +0300 |
commit | 057a5d5d435d53166d1b8751748a9ba0a317bee3 (patch) | |
tree | 6770b5ba1566c95e79ad73e845ac4a04c145cbec /bpkg/manifest | |
parent | d61e9338c8eda118c5f2afd93827be4a84bdc36a (diff) |
Add signature_manifest class
Diffstat (limited to 'bpkg/manifest')
-rw-r--r-- | bpkg/manifest | 33 |
1 files changed, 33 insertions, 0 deletions
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<char> 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 |