|
@ -1,6 +1,6 @@ |
|
|
/* ex:ts=4:sw=4:sts=4:et */ |
|
|
/* ex:ts=4:sw=4:sts=4:et */ |
|
|
/* -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
|
|
/* -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
|
|
/** |
|
|
|
|
|
|
|
|
/* |
|
|
* This program is free software; you can redistribute it and/or modify |
|
|
* This program is free software; you can redistribute it and/or modify |
|
|
* it under the terms of the GNU General Public License version 2 as |
|
|
* it under the terms of the GNU General Public License version 2 as |
|
|
* published by the Free Software Foundation. |
|
|
* published by the Free Software Foundation. |
|
@ -14,14 +14,13 @@ |
|
|
* with this program; if not, write to the Free Software Foundation, Inc., |
|
|
* with this program; if not, write to the Free Software Foundation, Inc., |
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
|
|
* |
|
|
* |
|
|
* AUTHORS |
|
|
|
|
|
* Maciek Borzecki <maciek.borzecki (at] gmail.com> |
|
|
|
|
|
|
|
|
* Author: Maciek Borzecki <maciek.borzecki (at] gmail.com> |
|
|
*/ |
|
|
*/ |
|
|
#ifndef __MCONN_CRYPT_H__ |
|
|
#ifndef __MCONN_CRYPT_H__ |
|
|
#define __MCONN_CRYPT_H__ |
|
|
#define __MCONN_CRYPT_H__ |
|
|
|
|
|
|
|
|
#include <glib-object.h> |
|
|
#include <glib-object.h> |
|
|
|
|
|
|
|
|
|
|
|
#include <glib.h> |
|
|
|
|
|
|
|
|
G_BEGIN_DECLS |
|
|
G_BEGIN_DECLS |
|
|
|
|
|
|
|
@ -48,25 +47,54 @@ G_BEGIN_DECLS |
|
|
|
|
|
|
|
|
typedef struct _MConnCrypt MConnCrypt; |
|
|
typedef struct _MConnCrypt MConnCrypt; |
|
|
typedef struct _MConnCryptClass MConnCryptClass; |
|
|
typedef struct _MConnCryptClass MConnCryptClass; |
|
|
typedef struct _MConnCryptPrivate MConnCryptPrivate; |
|
|
|
|
|
|
|
|
|
|
|
struct _MConnCryptClass |
|
|
struct _MConnCryptClass |
|
|
{ |
|
|
{ |
|
|
GObjectClass parent_class; |
|
|
GObjectClass parent_class; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
struct _MConnCrypt |
|
|
|
|
|
{ |
|
|
|
|
|
GObject parent; |
|
|
|
|
|
MConnCryptPrivate *priv; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
GType mconn_crypt_get_type (void) G_GNUC_CONST; |
|
|
GType mconn_crypt_get_type (void) G_GNUC_CONST; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* mconn_crypt_new_for_key_path: |
|
|
|
|
|
* @path: key path |
|
|
|
|
|
* |
|
|
|
|
|
* Returns: (transfer full) (element-type MConnCrypt): new object |
|
|
|
|
|
*/ |
|
|
MConnCrypt *mconn_crypt_new_for_key_path(const char *path); |
|
|
MConnCrypt *mconn_crypt_new_for_key_path(const char *path); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* mconn_crypt_unref: |
|
|
|
|
|
* @crypt: crypt object |
|
|
|
|
|
*/ |
|
|
|
|
|
void mconn_crypt_unref(MConnCrypt *crypt); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* mconn_crypt_ref: |
|
|
|
|
|
* @crypt: crypt object |
|
|
|
|
|
* |
|
|
|
|
|
* Take reference to crypt object |
|
|
|
|
|
* Returns: (transfer none): reffed object |
|
|
|
|
|
*/ |
|
|
void mconn_crypt_unref(MConnCrypt *crypt); |
|
|
void mconn_crypt_unref(MConnCrypt *crypt); |
|
|
GBytes * mconn_crypt_decrypt(MConnCrypt *crypt, GBytes *data, GError **err); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* mconn_crypt_decrypt: |
|
|
|
|
|
* @crypt: crypt object |
|
|
|
|
|
* @data: (type GBytes): data |
|
|
|
|
|
* @error: return location for a GError or NULL |
|
|
|
|
|
* |
|
|
|
|
|
* Returns: (transfer full): a new #GBytes with decoded data |
|
|
|
|
|
*/ |
|
|
|
|
|
GBytes * mconn_crypt_decrypt(MConnCrypt *crypt, GBytes *data, GError **error); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* mconn_crypt_get_public_key_pem: |
|
|
|
|
|
* @crypt: crypt object |
|
|
|
|
|
* |
|
|
|
|
|
* Returns: (transfer full): allocated string with public key in PEM format |
|
|
|
|
|
*/ |
|
|
gchar * mconn_crypt_get_public_key_pem(MConnCrypt *crypt); |
|
|
gchar * mconn_crypt_get_public_key_pem(MConnCrypt *crypt); |
|
|
|
|
|
|
|
|
G_END_DECLS |
|
|
G_END_DECLS |
|
|
|
|
|
|
|
|
#endif /* __MCONN_CRYPT_H__ */ |
|
|
#endif /* __MCONN_CRYPT_H__ */ |