Return to botan_rsa_public_key.h CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / src / libstrongswan / plugins / botan |
1.1 misho 1: /* 2: * Copyright (C) 2018 Tobias Brunner 3: * HSR Hochschule fuer Technik Rapperswil 4: * 5: * Copyright (C) 2018 René Korthaus 6: * Rohde & Schwarz Cybersecurity GmbH 7: * 8: * Permission is hereby granted, free of charge, to any person obtaining a copy 9: * of this software and associated documentation files (the "Software"), to deal 10: * in the Software without restriction, including without limitation the rights 11: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12: * copies of the Software, and to permit persons to whom the Software is 13: * furnished to do so, subject to the following conditions: 14: * 15: * The above copyright notice and this permission notice shall be included in 16: * all copies or substantial portions of the Software. 17: * 18: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24: * THE SOFTWARE. 25: */ 26: 27: /** 28: * @defgroup botan_rsa_public_key botan_rsa_public_key 29: * @{ @ingroup botan_p 30: */ 31: 32: #ifndef BOTAN_RSA_PUBLIC_KEY_H_ 33: #define BOTAN_RSA_PUBLIC_KEY_H_ 34: 35: #include <botan/ffi.h> 36: 37: #include <credentials/keys/public_key.h> 38: 39: typedef struct botan_rsa_public_key_t botan_rsa_public_key_t; 40: 41: /** 42: * public_key_t implementation of RSA algorithm using Botan. 43: */ 44: struct botan_rsa_public_key_t { 45: 46: /** 47: * Implements the public_key_t interface 48: */ 49: public_key_t key; 50: }; 51: 52: /** 53: * Load a RSA public key using Botan. 54: * 55: * Accepts a BUILD_RSA_MODULUS/BUILD_RSA_PUB_EXP arguments. 56: * 57: * @param type type of the key, must be KEY_RSA 58: * @param args builder_part_t argument list 59: * @return loaded key, NULL on failure 60: */ 61: botan_rsa_public_key_t *botan_rsa_public_key_load(key_type_t type, 62: va_list args); 63: 64: /** 65: * Load a RSA public key by adopting a botan_pubkey_t object. 66: * 67: * @param key public key object (adopted) 68: * @return loaded key, NULL on failure 69: */ 70: botan_rsa_public_key_t *botan_rsa_public_key_adopt(botan_pubkey_t key); 71: 72: #endif /** BOTAN_RSA_PUBLIC_KEY_H_ @}*/