NDEVR
API Documentation
PublicPrivateKey.h
1#pragma once
2#include "DLLInfo.h"
3#if NDEVR_HAS_SSL
4#include <NDEVR/Buffer.h>
5struct ec_key_st;
6struct ec_point_st;
7namespace NDEVR
8{
9 class File;
10 class PasswordString;
11 class StringView;
12 class UUID;
16 class NDEVR_SECURITY_API PublicPrivateKey
17 {
18 public:
19 PublicPrivateKey();
20 #ifndef Q_OS_WASM
21 PublicPrivateKey(File public_key, File private_key);
22 PublicPrivateKey(File private_key, const PasswordString& password);
23 #endif
24 PublicPrivateKey(Buffer<uint01> public_key, Buffer<uint01> private_key);
25 PublicPrivateKey(Buffer<uint01> private_key, const PasswordString& password);
26 PublicPrivateKey(const StringView& name, const PasswordString& password);
27 PublicPrivateKey(const StringView& name, const UUID& password);
28 PublicPrivateKey(const sint04 id, const PasswordString& password);
29 PublicPrivateKey(const PublicPrivateKey&) = delete;
30 ~PublicPrivateKey();
31 public:
32 #ifndef Q_OS_WASM
33 bool writePublicKey(File file) const;
34 bool writePrivateKey(File file) const;
35 bool writePrivateKey(File file, const PasswordString& password) const;
36 #endif
37 bool writePublicKey(Buffer<uint01>& data) const;
38 bool writePrivateKey(Buffer<uint01>& data) const;
39 bool writePrivateKey(Buffer<uint01>& data, const PasswordString& password) const;
40 bool isValid() const;
41 ec_point_st* generatePublicKey() const;
42 HighCapacityBuffer<uint01> encodeMessage(const uint01* encoded, uint08 size) const;
43 HighCapacityBuffer<uint01> decodeMessage(const uint01* encoded, uint08 size) const;
44 private:
45 bool m_is_private = false;
46 ec_key_st* m_key = nullptr;
47 };
48}
49#endif
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Definition File.h:53
When passwords are used inside the NDEVR engine, we don't want them logged or visible.
The core String View class for the NDEVR API.
Definition StringView.h:58
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
int32_t sint04
-Defines an alias representing a 4 byte, signed integer.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
@ file
The source file path associated with this object.
@ name
The display name of the object.