1 /** 2 * XMLSec library 3 * 4 * 5 * See Copyright for the status of this software. 6 * 7 * Copyright (C) 2002-2016 Aleksey Sanin <aleksey@aleksey.com>. All Rights Reserved. 8 */ 9 #ifndef __XMLSEC_APPS_CRYPTO_H__ 10 #define __XMLSEC_APPS_CRYPTO_H__ 11 12 #include <libxml/tree.h> 13 #include <xmlsec/xmlsec.h> 14 #include <xmlsec/keys.h> 15 #include <xmlsec/keyinfo.h> 16 #include <xmlsec/keysmngr.h> 17 #include <xmlsec/crypto.h> 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif /* __cplusplus */ 22 23 int xmlSecAppCryptoInit (const char* config); 24 int xmlSecAppCryptoShutdown (void); 25 26 xmlSecKeyPtr xmlSecAppCryptoKeyGenerate (const char* keyKlassAndSize, 27 const char* name, 28 xmlSecKeyDataType type); 29 30 /***************************************************************************** 31 * 32 * Simple keys manager 33 * 34 ****************************************************************************/ 35 int xmlSecAppCryptoSimpleKeysMngrInit (xmlSecKeysMngrPtr mngr); 36 int xmlSecAppCryptoSimpleKeysMngrLoad (xmlSecKeysMngrPtr mngr, 37 const char *filename); 38 int xmlSecAppCryptoSimpleKeysMngrSave (xmlSecKeysMngrPtr mngr, 39 const char *filename, 40 xmlSecKeyDataType type); 41 int xmlSecAppCryptoSimpleKeysMngrCertLoad (xmlSecKeysMngrPtr mngr, 42 const char *filename, 43 xmlSecKeyDataFormat format, 44 xmlSecKeyDataType type); 45 int xmlSecAppCryptoSimpleKeysMngrKeyAndCertsLoad (xmlSecKeysMngrPtr mngr, 46 const char *files, 47 const char* pwd, 48 const char* name, 49 xmlSecKeyDataFormat format); 50 int xmlSecAppCryptoSimpleKeysMngrPkcs12KeyLoad (xmlSecKeysMngrPtr mngr, 51 const char *filename, 52 const char* pwd, 53 const char *name); 54 int xmlSecAppCryptoSimpleKeysMngrBinaryKeyLoad (xmlSecKeysMngrPtr mngr, 55 const char* keyKlass, 56 const char* filename, 57 const char *name); 58 int xmlSecAppCryptoSimpleKeysMngrKeyGenerate (xmlSecKeysMngrPtr mngr, 59 const char* keyKlassAndSize, 60 const char* name); 61 62 63 #ifdef __cplusplus 64 } 65 #endif /* __cplusplus */ 66 67 #endif /* __XMLSEC_APPS_CRYPTO_H__ */ 68 69 70 71