summaryrefslogtreecommitdiffstats
path: root/include/svl/cryptosign.hxx
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-07-09 09:42:01 -0400
committerAshod Nakashian <ashnakash@gmail.com>2017-07-17 00:12:10 +0200
commit4f17445c12dc26c4881c4e486215b58d26515f8d (patch)
treed5532f4a3129fe532b4ad4305a44a8817c7e8b41 /include/svl/cryptosign.hxx
parenttools: create DateTime from Unix time (diff)
downloadcore-4f17445c12dc26c4881c4e486215b58d26515f8d.tar.gz
core-4f17445c12dc26c4881c4e486215b58d26515f8d.zip
svl: move byte-array verification from vcl
Also use comphelper::Base64 and DateTime::CreateFromUnixTime to avoid depending on sax. Change-Id: If1853f8d9481c9caa0625a111707531bbc495f75 Reviewed-on: https://gerrit.libreoffice.org/39993 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'include/svl/cryptosign.hxx')
-rw-r--r--include/svl/cryptosign.hxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/svl/cryptosign.hxx b/include/svl/cryptosign.hxx
index db0abc9f1480..ae82a59b33a4 100644
--- a/include/svl/cryptosign.hxx
+++ b/include/svl/cryptosign.hxx
@@ -14,8 +14,12 @@
#include <vector>
#include <rtl/strbuf.hxx>
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/uno/Reference.hxx>
+
#include <svl/svldllapi.h>
-#include "com/sun/star/uno/Reference.hxx"
+#include <svl/sigstruct.hxx>
namespace com {
namespace sun {
@@ -24,6 +28,8 @@ namespace security {
class XCertificate; }
}}}
+class SvStream;
+
namespace svl {
namespace crypto {
@@ -54,6 +60,13 @@ public:
/// Returns the signature (in PKCS#7 format) as string (hex).
bool Sign(OStringBuffer& rCMSHexBuffer);
+ /// Verify and get Signature Information given a signature and stream.
+ static bool Verify(SvStream& rStream,
+ const std::vector<std::pair<size_t, size_t>>& aByteRanges,
+ const bool bNonDetached,
+ const std::vector<unsigned char>& aSignature,
+ SignatureInformation& rInformation);
+
private:
/// The certificate to use for signing.
const css::uno::Reference<css::security::XCertificate> m_xCertificate;