File indexing completed on 2024-05-12 05:04:18

0001 // SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
0002 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0003 
0004 #pragma once
0005 
0006 #include <QByteArray>
0007 
0008 #include <openssl/ec.h>
0009 
0010 /// Generates a ECDH keypair using the prime256v1 curve.
0011 EC_KEY *generateECDHKeypair();
0012 
0013 /// Returns the private key of a ECDH keypair.
0014 QByteArray exportPrivateKey(const EC_KEY *key);
0015 
0016 /// Returns the public key of a ECDH keypair.
0017 QByteArray exportPublicKey(const EC_KEY *key);