/** * XML Security Library (http://www.aleksey.com/xmlsec). * * This is free software; see the Copyright file in the source distribution for precise wording. * * Copyright (C) 2002-2026 Aleksey Sanin . All Rights Reserved. */ #ifndef __XMLSEC_GNUTLS_APP_H__ #define __XMLSEC_GNUTLS_APP_H__ /** * @defgroup xmlsec_gnutls_app GnuTLS Application Helpers * @ingroup xmlsec_gnutls * @brief High-level application helpers for the GnuTLS back-end. * @{ */ #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /****************************************************************************** * * Init/shutdown * *****************************************************************************/ XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppInit (const char* config); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppShutdown (void); /****************************************************************************** * * Keys Manager * *****************************************************************************/ XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppDefaultKeysMngrInit (xmlSecKeysMngrPtr mngr); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppDefaultKeysMngrAdoptKey (xmlSecKeysMngrPtr mngr, xmlSecKeyPtr key); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppDefaultKeysMngrVerifyKey (xmlSecKeysMngrPtr mngr, xmlSecKeyPtr key, xmlSecKeyInfoCtxPtr keyInfoCtx); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppDefaultKeysMngrLoad (xmlSecKeysMngrPtr mngr, const char* uri); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppDefaultKeysMngrSave (xmlSecKeysMngrPtr mngr, const char* filename, xmlSecKeyDataType type); #ifndef XMLSEC_NO_X509 XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppKeysMngrCertLoad (xmlSecKeysMngrPtr mngr, const char *filename, xmlSecKeyDataFormat format, xmlSecKeyDataType type); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppKeysMngrCertLoadMemory (xmlSecKeysMngrPtr mngr, const xmlSecByte* data, xmlSecSize dataSize, xmlSecKeyDataFormat format, xmlSecKeyDataType type); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppKeysMngrCrlLoad (xmlSecKeysMngrPtr mngr, const char *filename, xmlSecKeyDataFormat format); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppKeysMngrCrlLoadMemory (xmlSecKeysMngrPtr mngr, const xmlSecByte* data, xmlSecSize dataSize, xmlSecKeyDataFormat format); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppKeysMngrCrlLoadAndVerify(xmlSecKeysMngrPtr mngr, const char *filename, xmlSecKeyDataFormat format, xmlSecKeyInfoCtxPtr keyInfoCtx); #endif /* XMLSEC_NO_X509 */ /****************************************************************************** * * Keys * *****************************************************************************/ XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecGnuTLSAppKeyLoadEx (const char *filename, xmlSecKeyDataType type, xmlSecKeyDataFormat format, const char *pwd, void *pwdCallback, void* pwdCallbackCtx); XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecGnuTLSAppKeyLoadMemory (const xmlSecByte* data, xmlSecSize dataSize, xmlSecKeyDataFormat format, const char *pwd, void* pwdCallback, void* pwdCallbackCtx); #ifndef XMLSEC_NO_X509 XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecGnuTLSAppPkcs12Load (const char *filename, const char *pwd, void* pwdCallback, void* pwdCallbackCtx); XMLSEC_CRYPTO_EXPORT xmlSecKeyPtr xmlSecGnuTLSAppPkcs12LoadMemory (const xmlSecByte* data, xmlSecSize dataSize, const char *pwd, void* pwdCallback, void* pwdCallbackCtx); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppKeyCertLoad (xmlSecKeyPtr key, const char* filename, xmlSecKeyDataFormat format); XMLSEC_CRYPTO_EXPORT int xmlSecGnuTLSAppKeyCertLoadMemory (xmlSecKeyPtr key, const xmlSecByte* data, xmlSecSize dataSize, xmlSecKeyDataFormat format); #endif /* XMLSEC_NO_X509 */ XMLSEC_CRYPTO_EXPORT void* xmlSecGnuTLSAppGetDefaultPwdCallback (void); #ifdef __cplusplus } #endif /* __cplusplus */ /** @} */ /** xmlsec_gnutls_app */ #endif /* __XMLSEC_GNUTLS_APP_H__ */