Delta Chat Core C-API
mrkeyring.h
1 /*******************************************************************************
2  *
3  * Delta Chat Core
4  * Copyright (C) 2017 Björn Petersen
5  * Contact: r10s@b44t.com, http://b44t.com
6  *
7  * This program is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License as published by the Free Software
9  * Foundation, either version 3 of the License, or (at your option) any later
10  * version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program. If not, see http://www.gnu.org/licenses/ .
19  *
20  ******************************************************************************/
21 
22 
23 #ifndef __MRKEYRING_H__
24 #define __MRKEYRING_H__
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 typedef struct mrkey_t mrkey_t;
31 
32 
36 typedef struct mrkeyring_t
37 {
40  mrkey_t** m_keys;
41  int m_count;
42  int m_allocated;
43 } mrkeyring_t;
44 
45 mrkeyring_t* mrkeyring_new ();
46 void mrkeyring_unref();
47 
48 void mrkeyring_add (mrkeyring_t*, mrkey_t*); /* the reference counter of the key is increased by one */
49 
50 int mrkeyring_load_self_private_for_decrypting__(mrkeyring_t*, const char* self_addr, mrsqlite3_t* sql);
51 
52 
53 #ifdef __cplusplus
54 } /* /extern "C" */
55 #endif
56 #endif /* __MRKEYRING_H__ */
57