Pajdeg  0.2.2
Pajdeg
pd_crypto.h
Go to the documentation of this file.
1 //
2 // pd_crypto.h
3 //
4 // Copyright (c) 2012 - 2015 Karl-Johan Alm (http://github.com/kallewoof)
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in
14 // all copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 // THE SOFTWARE.
23 //
24 
25 
42 #ifndef INCLUDED_PD_CRYPTO_H
43 #define INCLUDED_PD_CRYPTO_H
44 
45 #include <sys/types.h>
46 #include "PDDefines.h"
47 
48 #ifdef PD_SUPPORT_CRYPTO
49 
57 extern pd_crypto pd_crypto_create(PDDictionaryRef trailerDict, PDDictionaryRef options);
58 
62 extern void pd_crypto_destroy(pd_crypto crypto);
63 
74 extern PDInteger pd_crypto_unescape(char *str);
75 
87 extern PDInteger pd_crypto_unescape_explicit_len(char *str, int len);
88 
101 extern PDInteger pd_crypto_escape(char **dst, const char *src, PDInteger srcLen);
102 
117 extern PDInteger pd_crypto_secure(char **dst, const char *src, PDInteger srcLen);
118 
126 extern PDBool pd_crypto_authenticate_user(pd_crypto crypto, const char *password);
127 
139 extern PDInteger pd_crypto_encrypt(pd_crypto crypto, PDInteger obid, PDInteger genid, char **dst, char *src, PDInteger len);
140 
149 extern void pd_crypto_decrypt(pd_crypto crypto, PDInteger obid, PDInteger genid, char *data);
150 
164 extern void pd_crypto_convert(pd_crypto crypto, PDInteger obid, PDInteger genid, char *data, PDInteger len);
165 
166 extern PDStringRef pd_crypto_get_filter(pd_crypto crypto);
167 extern PDStringRef pd_crypto_get_subfilter(pd_crypto crypto);
168 extern PDInteger pd_crypto_get_version(pd_crypto crypto);
169 extern PDInteger pd_crypto_get_revision(pd_crypto crypto);
170 extern PDBool pd_crypto_get_encrypt_metadata_bool(pd_crypto crypto);
171 extern pd_crypto_method pd_crypto_get_method(pd_crypto crypto);
172 extern pd_auth_event pd_crypto_get_auth_event(pd_crypto crypto);
173 
174 #endif
175 
176 #endif
177 
pd_auth_event
Definition: PDDefines.h:417
long PDInteger
Definition: PDDefines.h:184
void pd_crypto_convert(pd_crypto crypto, PDInteger obid, PDInteger genid, char *data, PDInteger len)
Definition: pd_crypto.c:420
unsigned char PDBool
Definition: PDDefines.h:207
PDInteger pd_crypto_unescape_explicit_len(char *str, int len)
Definition: pd_crypto.c:200
PDInteger pd_crypto_escape(char **dst, const char *src, PDInteger srcLen)
Definition: pd_crypto.c:368
PDInteger pd_crypto_unescape(char *str)
Definition: pd_crypto.c:195
pd_crypto_method
Definition: PDDefines.h:408
PDInteger pd_crypto_secure(char **dst, const char *src, PDInteger srcLen)
Definition: pd_crypto.c:409
pd_crypto pd_crypto_create(PDDictionaryRef trailerDict, PDDictionaryRef options)
Definition: pd_crypto.c:281
PDInteger pd_crypto_encrypt(pd_crypto crypto, PDInteger obid, PDInteger genid, char **dst, char *src, PDInteger len)
Definition: pd_crypto.c:483
void pd_crypto_decrypt(pd_crypto crypto, PDInteger obid, PDInteger genid, char *data)
Definition: pd_crypto.c:495
void pd_crypto_destroy(pd_crypto crypto)
Definition: pd_crypto.c:154
Definition: pd_internal.h:718
Definition: pd_internal.h:639
Definition: pd_internal.h:887
Definitions for the Pajdeg interface.
PDBool pd_crypto_authenticate_user(pd_crypto crypto, const char *password)