Annotation of embedaddon/strongswan/src/libstrongswan/plugins/botan/botan_ec_private_key.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:  * Copyright (C) 2018 Tobias Brunner
                      3:  * HSR Hochschule fuer Technik Rapperswil
                      4:  *
                      5:  * Copyright (C) 2018 RenĂ© Korthaus
                      6:  * Copyright (C) 2018 Konstantinos Kolelis
                      7:  * Rohde & Schwarz Cybersecurity GmbH
                      8:  *
                      9:  * Permission is hereby granted, free of charge, to any person obtaining a copy
                     10:  * of this software and associated documentation files (the "Software"), to deal
                     11:  * in the Software without restriction, including without limitation the rights
                     12:  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
                     13:  * copies of the Software, and to permit persons to whom the Software is
                     14:  * furnished to do so, subject to the following conditions:
                     15:  *
                     16:  * The above copyright notice and this permission notice shall be included in
                     17:  * all copies or substantial portions of the Software.
                     18:  *
                     19:  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
                     20:  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
                     21:  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
                     22:  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
                     23:  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
                     24:  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
                     25:  * THE SOFTWARE.
                     26:  */
                     27: 
                     28: /**
                     29:  * @defgroup botan_ec_private_key botan_ec_private_key
                     30:  * @{ @ingroup botan_p
                     31:  */
                     32: 
                     33: #ifndef BOTAN_EC_PRIVATE_KEY_H_
                     34: #define BOTAN_EC_PRIVATE_KEY_H_
                     35: 
                     36: #include <botan/ffi.h>
                     37: 
                     38: #include <credentials/builder.h>
                     39: #include <credentials/keys/private_key.h>
                     40: 
                     41: typedef struct botan_ec_private_key_t botan_ec_private_key_t;
                     42: 
                     43: /**
                     44:  * private_key_t implementation of ECDSA using Botan.
                     45:  */
                     46: struct botan_ec_private_key_t {
                     47: 
                     48:        /**
                     49:         * Implements private_key_t interface
                     50:         */
                     51:        private_key_t key;
                     52: };
                     53: 
                     54: /**
                     55:  * Generate a ECDSA private key using Botan.
                     56:  *
                     57:  * Accepts the BUILD_KEY_SIZE argument.
                     58:  *
                     59:  * @param type         type of the key, must be KEY_ECDSA
                     60:  * @param args         builder_part_t argument list
                     61:  * @return                     generated key, NULL on failure
                     62:  */
                     63: botan_ec_private_key_t *botan_ec_private_key_gen(key_type_t type, va_list args);
                     64: 
                     65: /**
                     66:  * Load a ECDSA private key using Botan.
                     67:  *
                     68:  * Accepts a BUILD_BLOB_ASN1_DER argument.
                     69:  *
                     70:  * @param type         type of the key, must be KEY_ECDSA
                     71:  * @param args         builder_part_t argument list
                     72:  * @return                     loaded key, NULL on failure
                     73:  */
                     74: botan_ec_private_key_t *botan_ec_private_key_load(key_type_t type,
                     75:                                                                                                  va_list args);
                     76: 
                     77: /**
                     78:  * Load a ECDSA private key by adopting a botan_privkey_t object.
                     79:  *
                     80:  * @param key          private key object (adopted)
                     81:  * @param oid          EC curve OID
                     82:  * @return                     loaded key, NULL on failure
                     83:  */
                     84: botan_ec_private_key_t *botan_ec_private_key_adopt(botan_privkey_t key,
                     85:                                                                                                   int oid);
                     86: 
                     87: #endif /** BOTAN_EC_PRIVATE_KEY_H_ @}*/

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>