summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-sign-dummy.h
diff options
context:
space:
mode:
authorDenis Pynkin <denis.pynkin@collabora.com>2019-07-29 02:32:28 +0300
committerDenis Pynkin <denis.pynkin@collabora.com>2020-03-25 15:23:54 +0300
commitedbbe1c4f2267c0d95d4ee14f6cbc516a1d31dca (patch)
treee3c6c25522ff009865283668ec1ee28fabe4d511 /src/libostree/ostree-sign-dummy.h
parent84c8164610ee3df9bbd06f0be9e37a873708ec2d (diff)
downloadostree-edbbe1c4f2267c0d95d4ee14f6cbc516a1d31dca.tar.gz
lib/sign: initial implementation
Added the initial version of signing interface allowing to allowing to sign and verify commits. Implemented initial signing modules: - dummy -- simple module allowing to sign/verify with ASCII string - ed25519 -- module allowing to sign/verify commit with ed25519 (EdDSA) signature scheme provided by libsodium library. Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Diffstat (limited to 'src/libostree/ostree-sign-dummy.h')
-rw-r--r--src/libostree/ostree-sign-dummy.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/libostree/ostree-sign-dummy.h b/src/libostree/ostree-sign-dummy.h
new file mode 100644
index 00000000..8bbd407d
--- /dev/null
+++ b/src/libostree/ostree-sign-dummy.h
@@ -0,0 +1,63 @@
+/* vim:set et sw=2 cin cino=t0,f0,(0,{s,>2s,n-s,^-s,e2s: */
+
+/*
+ * Copyright © 2019 Collabora Ltd.
+ *
+ * SPDX-License-Identifier: LGPL-2.0+
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * - Denis Pynkin (d4s) <denis.pynkin@collabora.com>
+ */
+
+#pragma once
+
+#include "ostree-sign.h"
+
+G_BEGIN_DECLS
+
+#define OSTREE_TYPE_SIGN_DUMMY (ostree_sign_dummy_get_type ())
+
+_OSTREE_PUBLIC
+G_DECLARE_FINAL_TYPE (OstreeSignDummy,
+ ostree_sign_dummy,
+ OSTREE,
+ SIGN_DUMMY,
+ GObject)
+
+gchar * ostree_sign_dummy_get_name (OstreeSign *self);
+
+gboolean ostree_sign_dummy_data (OstreeSign *self,
+ GBytes *data,
+ GBytes **signature,
+ GCancellable *cancellable,
+ GError **error);
+
+gchar * ostree_sign_dummy_metadata_key (OstreeSign *self);
+gchar * ostree_sign_dummy_metadata_format (OstreeSign *self);
+
+gboolean ostree_sign_dummy_metadata_verify (OstreeSign *self,
+ GBytes *data,
+ GVariant *signatures,
+ GError **error);
+
+gboolean ostree_sign_dummy_set_signature (OstreeSign *self, GVariant *key, GError **error);
+
+void ostree_sign_dummy_finalize (GObject *gobject);
+
+G_END_DECLS
+