react-native-quick-crypto 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/CMakeLists.txt +9 -0
- package/cpp/argon2/HybridArgon2.cpp +103 -0
- package/cpp/argon2/HybridArgon2.hpp +32 -0
- package/cpp/certificate/HybridCertificate.cpp +42 -0
- package/cpp/certificate/HybridCertificate.hpp +16 -0
- package/cpp/cipher/HybridCipher.cpp +58 -0
- package/cpp/cipher/HybridCipher.hpp +4 -0
- package/cpp/dh/HybridDhKeyPair.cpp +179 -0
- package/cpp/dh/HybridDhKeyPair.hpp +37 -0
- package/cpp/dsa/HybridDsaKeyPair.cpp +128 -0
- package/cpp/dsa/HybridDsaKeyPair.hpp +32 -0
- package/cpp/ecdh/HybridECDH.cpp +35 -0
- package/cpp/ecdh/HybridECDH.hpp +1 -0
- package/cpp/keys/HybridKeyObjectHandle.cpp +19 -0
- package/cpp/prime/HybridPrime.cpp +81 -0
- package/cpp/prime/HybridPrime.hpp +20 -0
- package/lib/commonjs/argon2.js +39 -0
- package/lib/commonjs/argon2.js.map +1 -0
- package/lib/commonjs/certificate.js +35 -0
- package/lib/commonjs/certificate.js.map +1 -0
- package/lib/commonjs/cipher.js +8 -0
- package/lib/commonjs/cipher.js.map +1 -1
- package/lib/commonjs/dhKeyPair.js +109 -0
- package/lib/commonjs/dhKeyPair.js.map +1 -0
- package/lib/commonjs/dsa.js +92 -0
- package/lib/commonjs/dsa.js.map +1 -0
- package/lib/commonjs/ecdh.js +37 -0
- package/lib/commonjs/ecdh.js.map +1 -1
- package/lib/commonjs/index.js +35 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/keys/classes.js +9 -7
- package/lib/commonjs/keys/classes.js.map +1 -1
- package/lib/commonjs/keys/generateKeyPair.js +11 -0
- package/lib/commonjs/keys/generateKeyPair.js.map +1 -1
- package/lib/commonjs/prime.js +84 -0
- package/lib/commonjs/prime.js.map +1 -0
- package/lib/commonjs/specs/argon2.nitro.js +6 -0
- package/lib/commonjs/specs/argon2.nitro.js.map +1 -0
- package/lib/commonjs/specs/certificate.nitro.js +6 -0
- package/lib/commonjs/specs/certificate.nitro.js.map +1 -0
- package/lib/commonjs/specs/dhKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/dhKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/dsaKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/dsaKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/prime.nitro.js +6 -0
- package/lib/commonjs/specs/prime.nitro.js.map +1 -0
- package/lib/commonjs/subtle.js +101 -10
- package/lib/commonjs/subtle.js.map +1 -1
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/module/argon2.js +34 -0
- package/lib/module/argon2.js.map +1 -0
- package/lib/module/certificate.js +30 -0
- package/lib/module/certificate.js.map +1 -0
- package/lib/module/cipher.js +7 -0
- package/lib/module/cipher.js.map +1 -1
- package/lib/module/dhKeyPair.js +102 -0
- package/lib/module/dhKeyPair.js.map +1 -0
- package/lib/module/dsa.js +85 -0
- package/lib/module/dsa.js.map +1 -0
- package/lib/module/ecdh.js +37 -0
- package/lib/module/ecdh.js.map +1 -1
- package/lib/module/index.js +9 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/keys/classes.js +9 -7
- package/lib/module/keys/classes.js.map +1 -1
- package/lib/module/keys/generateKeyPair.js +11 -0
- package/lib/module/keys/generateKeyPair.js.map +1 -1
- package/lib/module/prime.js +77 -0
- package/lib/module/prime.js.map +1 -0
- package/lib/module/specs/argon2.nitro.js +4 -0
- package/lib/module/specs/argon2.nitro.js.map +1 -0
- package/lib/module/specs/certificate.nitro.js +4 -0
- package/lib/module/specs/certificate.nitro.js.map +1 -0
- package/lib/module/specs/dhKeyPair.nitro.js +4 -0
- package/lib/module/specs/dhKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/dsaKeyPair.nitro.js +4 -0
- package/lib/module/specs/dsaKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/prime.nitro.js +4 -0
- package/lib/module/specs/prime.nitro.js.map +1 -0
- package/lib/module/subtle.js +102 -12
- package/lib/module/subtle.js.map +1 -1
- package/lib/module/utils/types.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/typescript/argon2.d.ts +16 -0
- package/lib/typescript/argon2.d.ts.map +1 -0
- package/lib/typescript/certificate.d.ts +8 -0
- package/lib/typescript/certificate.d.ts.map +1 -0
- package/lib/typescript/cipher.d.ts +12 -0
- package/lib/typescript/cipher.d.ts.map +1 -1
- package/lib/typescript/dhKeyPair.d.ts +19 -0
- package/lib/typescript/dhKeyPair.d.ts.map +1 -0
- package/lib/typescript/dsa.d.ts +19 -0
- package/lib/typescript/dsa.d.ts.map +1 -0
- package/lib/typescript/ecdh.d.ts +3 -0
- package/lib/typescript/ecdh.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +17 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/keys/classes.d.ts +2 -0
- package/lib/typescript/keys/classes.d.ts.map +1 -1
- package/lib/typescript/keys/generateKeyPair.d.ts.map +1 -1
- package/lib/typescript/prime.d.ts +19 -0
- package/lib/typescript/prime.d.ts.map +1 -0
- package/lib/typescript/specs/argon2.nitro.d.ts +9 -0
- package/lib/typescript/specs/argon2.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/certificate.nitro.d.ts +10 -0
- package/lib/typescript/specs/certificate.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/cipher.nitro.d.ts +9 -0
- package/lib/typescript/specs/cipher.nitro.d.ts.map +1 -1
- package/lib/typescript/specs/dhKeyPair.nitro.d.ts +14 -0
- package/lib/typescript/specs/dhKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/dsaKeyPair.nitro.d.ts +13 -0
- package/lib/typescript/specs/dsaKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/ecdh.nitro.d.ts +1 -0
- package/lib/typescript/specs/ecdh.nitro.d.ts.map +1 -1
- package/lib/typescript/specs/prime.nitro.d.ts +11 -0
- package/lib/typescript/specs/prime.nitro.d.ts.map +1 -0
- package/lib/typescript/subtle.d.ts +2 -0
- package/lib/typescript/subtle.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +13 -3
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/nitrogen/generated/android/QuickCrypto+autolinking.cmake +5 -0
- package/nitrogen/generated/android/QuickCryptoOnLoad.cpp +50 -0
- package/nitrogen/generated/ios/QuickCryptoAutolinking.mm +50 -0
- package/nitrogen/generated/shared/c++/CipherInfo.hpp +104 -0
- package/nitrogen/generated/shared/c++/HybridArgon2Spec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridArgon2Spec.hpp +66 -0
- package/nitrogen/generated/shared/c++/HybridCertificateSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridCertificateSpec.hpp +64 -0
- package/nitrogen/generated/shared/c++/HybridCipherSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridCipherSpec.hpp +4 -0
- package/nitrogen/generated/shared/c++/HybridDhKeyPairSpec.cpp +27 -0
- package/nitrogen/generated/shared/c++/HybridDhKeyPairSpec.hpp +69 -0
- package/nitrogen/generated/shared/c++/HybridDsaKeyPairSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridDsaKeyPairSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/HybridECDHSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridECDHSpec.hpp +1 -0
- package/nitrogen/generated/shared/c++/HybridPrimeSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridPrimeSpec.hpp +67 -0
- package/package.json +1 -1
- package/src/argon2.ts +83 -0
- package/src/certificate.ts +41 -0
- package/src/cipher.ts +24 -0
- package/src/dhKeyPair.ts +156 -0
- package/src/dsa.ts +129 -0
- package/src/ecdh.ts +59 -0
- package/src/index.ts +9 -0
- package/src/keys/classes.ts +16 -5
- package/src/keys/generateKeyPair.ts +14 -0
- package/src/prime.ts +134 -0
- package/src/specs/argon2.nitro.ts +29 -0
- package/src/specs/certificate.nitro.ts +8 -0
- package/src/specs/cipher.nitro.ts +14 -0
- package/src/specs/dhKeyPair.nitro.ts +14 -0
- package/src/specs/dsaKeyPair.nitro.ts +13 -0
- package/src/specs/ecdh.nitro.ts +1 -0
- package/src/specs/prime.nitro.ts +18 -0
- package/src/subtle.ts +271 -12
- package/src/utils/types.ts +22 -3
|
@@ -15,10 +15,14 @@
|
|
|
15
15
|
#include <fbjni/fbjni.h>
|
|
16
16
|
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
17
|
|
|
18
|
+
#include "HybridArgon2.hpp"
|
|
18
19
|
#include "HybridBlake3.hpp"
|
|
20
|
+
#include "HybridCertificate.hpp"
|
|
19
21
|
#include "HybridCipher.hpp"
|
|
20
22
|
#include "HybridCipherFactory.hpp"
|
|
23
|
+
#include "HybridDhKeyPair.hpp"
|
|
21
24
|
#include "HybridDiffieHellman.hpp"
|
|
25
|
+
#include "HybridDsaKeyPair.hpp"
|
|
22
26
|
#include "HybridECDH.hpp"
|
|
23
27
|
#include "HybridEcKeyPair.hpp"
|
|
24
28
|
#include "HybridEdKeyPair.hpp"
|
|
@@ -28,6 +32,7 @@
|
|
|
28
32
|
#include "HybridKeyObjectHandle.hpp"
|
|
29
33
|
#include "HybridMlDsaKeyPair.hpp"
|
|
30
34
|
#include "HybridPbkdf2.hpp"
|
|
35
|
+
#include "HybridPrime.hpp"
|
|
31
36
|
#include "HybridRandom.hpp"
|
|
32
37
|
#include "HybridRsaCipher.hpp"
|
|
33
38
|
#include "HybridRsaKeyPair.hpp"
|
|
@@ -48,6 +53,15 @@ int initialize(JavaVM* vm) {
|
|
|
48
53
|
|
|
49
54
|
|
|
50
55
|
// Register Nitro Hybrid Objects
|
|
56
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
57
|
+
"Argon2",
|
|
58
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
59
|
+
static_assert(std::is_default_constructible_v<HybridArgon2>,
|
|
60
|
+
"The HybridObject \"HybridArgon2\" is not default-constructible! "
|
|
61
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
62
|
+
return std::make_shared<HybridArgon2>();
|
|
63
|
+
}
|
|
64
|
+
);
|
|
51
65
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
52
66
|
"Blake3",
|
|
53
67
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -57,6 +71,15 @@ int initialize(JavaVM* vm) {
|
|
|
57
71
|
return std::make_shared<HybridBlake3>();
|
|
58
72
|
}
|
|
59
73
|
);
|
|
74
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
75
|
+
"Certificate",
|
|
76
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
77
|
+
static_assert(std::is_default_constructible_v<HybridCertificate>,
|
|
78
|
+
"The HybridObject \"HybridCertificate\" is not default-constructible! "
|
|
79
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
80
|
+
return std::make_shared<HybridCertificate>();
|
|
81
|
+
}
|
|
82
|
+
);
|
|
60
83
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
61
84
|
"Cipher",
|
|
62
85
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -75,6 +98,15 @@ int initialize(JavaVM* vm) {
|
|
|
75
98
|
return std::make_shared<HybridCipherFactory>();
|
|
76
99
|
}
|
|
77
100
|
);
|
|
101
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
102
|
+
"DhKeyPair",
|
|
103
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
104
|
+
static_assert(std::is_default_constructible_v<HybridDhKeyPair>,
|
|
105
|
+
"The HybridObject \"HybridDhKeyPair\" is not default-constructible! "
|
|
106
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
107
|
+
return std::make_shared<HybridDhKeyPair>();
|
|
108
|
+
}
|
|
109
|
+
);
|
|
78
110
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
79
111
|
"DiffieHellman",
|
|
80
112
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -84,6 +116,15 @@ int initialize(JavaVM* vm) {
|
|
|
84
116
|
return std::make_shared<HybridDiffieHellman>();
|
|
85
117
|
}
|
|
86
118
|
);
|
|
119
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
120
|
+
"DsaKeyPair",
|
|
121
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
122
|
+
static_assert(std::is_default_constructible_v<HybridDsaKeyPair>,
|
|
123
|
+
"The HybridObject \"HybridDsaKeyPair\" is not default-constructible! "
|
|
124
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
125
|
+
return std::make_shared<HybridDsaKeyPair>();
|
|
126
|
+
}
|
|
127
|
+
);
|
|
87
128
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
88
129
|
"ECDH",
|
|
89
130
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -165,6 +206,15 @@ int initialize(JavaVM* vm) {
|
|
|
165
206
|
return std::make_shared<HybridPbkdf2>();
|
|
166
207
|
}
|
|
167
208
|
);
|
|
209
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
210
|
+
"Prime",
|
|
211
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
212
|
+
static_assert(std::is_default_constructible_v<HybridPrime>,
|
|
213
|
+
"The HybridObject \"HybridPrime\" is not default-constructible! "
|
|
214
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
215
|
+
return std::make_shared<HybridPrime>();
|
|
216
|
+
}
|
|
217
|
+
);
|
|
168
218
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
169
219
|
"Random",
|
|
170
220
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -10,10 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
#import <type_traits>
|
|
12
12
|
|
|
13
|
+
#include "HybridArgon2.hpp"
|
|
13
14
|
#include "HybridBlake3.hpp"
|
|
15
|
+
#include "HybridCertificate.hpp"
|
|
14
16
|
#include "HybridCipher.hpp"
|
|
15
17
|
#include "HybridCipherFactory.hpp"
|
|
18
|
+
#include "HybridDhKeyPair.hpp"
|
|
16
19
|
#include "HybridDiffieHellman.hpp"
|
|
20
|
+
#include "HybridDsaKeyPair.hpp"
|
|
17
21
|
#include "HybridECDH.hpp"
|
|
18
22
|
#include "HybridEcKeyPair.hpp"
|
|
19
23
|
#include "HybridEdKeyPair.hpp"
|
|
@@ -23,6 +27,7 @@
|
|
|
23
27
|
#include "HybridKeyObjectHandle.hpp"
|
|
24
28
|
#include "HybridMlDsaKeyPair.hpp"
|
|
25
29
|
#include "HybridPbkdf2.hpp"
|
|
30
|
+
#include "HybridPrime.hpp"
|
|
26
31
|
#include "HybridRandom.hpp"
|
|
27
32
|
#include "HybridRsaCipher.hpp"
|
|
28
33
|
#include "HybridRsaKeyPair.hpp"
|
|
@@ -40,6 +45,15 @@
|
|
|
40
45
|
using namespace margelo::nitro;
|
|
41
46
|
using namespace margelo::nitro::crypto;
|
|
42
47
|
|
|
48
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
49
|
+
"Argon2",
|
|
50
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
51
|
+
static_assert(std::is_default_constructible_v<HybridArgon2>,
|
|
52
|
+
"The HybridObject \"HybridArgon2\" is not default-constructible! "
|
|
53
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
54
|
+
return std::make_shared<HybridArgon2>();
|
|
55
|
+
}
|
|
56
|
+
);
|
|
43
57
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
44
58
|
"Blake3",
|
|
45
59
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -49,6 +63,15 @@
|
|
|
49
63
|
return std::make_shared<HybridBlake3>();
|
|
50
64
|
}
|
|
51
65
|
);
|
|
66
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
67
|
+
"Certificate",
|
|
68
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
69
|
+
static_assert(std::is_default_constructible_v<HybridCertificate>,
|
|
70
|
+
"The HybridObject \"HybridCertificate\" is not default-constructible! "
|
|
71
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
72
|
+
return std::make_shared<HybridCertificate>();
|
|
73
|
+
}
|
|
74
|
+
);
|
|
52
75
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
53
76
|
"Cipher",
|
|
54
77
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -67,6 +90,15 @@
|
|
|
67
90
|
return std::make_shared<HybridCipherFactory>();
|
|
68
91
|
}
|
|
69
92
|
);
|
|
93
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
94
|
+
"DhKeyPair",
|
|
95
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
96
|
+
static_assert(std::is_default_constructible_v<HybridDhKeyPair>,
|
|
97
|
+
"The HybridObject \"HybridDhKeyPair\" is not default-constructible! "
|
|
98
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
99
|
+
return std::make_shared<HybridDhKeyPair>();
|
|
100
|
+
}
|
|
101
|
+
);
|
|
70
102
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
71
103
|
"DiffieHellman",
|
|
72
104
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -76,6 +108,15 @@
|
|
|
76
108
|
return std::make_shared<HybridDiffieHellman>();
|
|
77
109
|
}
|
|
78
110
|
);
|
|
111
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
112
|
+
"DsaKeyPair",
|
|
113
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
114
|
+
static_assert(std::is_default_constructible_v<HybridDsaKeyPair>,
|
|
115
|
+
"The HybridObject \"HybridDsaKeyPair\" is not default-constructible! "
|
|
116
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
117
|
+
return std::make_shared<HybridDsaKeyPair>();
|
|
118
|
+
}
|
|
119
|
+
);
|
|
79
120
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
80
121
|
"ECDH",
|
|
81
122
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -157,6 +198,15 @@
|
|
|
157
198
|
return std::make_shared<HybridPbkdf2>();
|
|
158
199
|
}
|
|
159
200
|
);
|
|
201
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
202
|
+
"Prime",
|
|
203
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
204
|
+
static_assert(std::is_default_constructible_v<HybridPrime>,
|
|
205
|
+
"The HybridObject \"HybridPrime\" is not default-constructible! "
|
|
206
|
+
"Create a public constructor that takes zero arguments to be able to autolink this HybridObject.");
|
|
207
|
+
return std::make_shared<HybridPrime>();
|
|
208
|
+
}
|
|
209
|
+
);
|
|
160
210
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
161
211
|
"Random",
|
|
162
212
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CipherInfo.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
#include <optional>
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::crypto {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (CipherInfo).
|
|
40
|
+
*/
|
|
41
|
+
struct CipherInfo final {
|
|
42
|
+
public:
|
|
43
|
+
std::string name SWIFT_PRIVATE;
|
|
44
|
+
double nid SWIFT_PRIVATE;
|
|
45
|
+
std::string mode SWIFT_PRIVATE;
|
|
46
|
+
double keyLength SWIFT_PRIVATE;
|
|
47
|
+
std::optional<double> blockSize SWIFT_PRIVATE;
|
|
48
|
+
std::optional<double> ivLength SWIFT_PRIVATE;
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
CipherInfo() = default;
|
|
52
|
+
explicit CipherInfo(std::string name, double nid, std::string mode, double keyLength, std::optional<double> blockSize, std::optional<double> ivLength): name(name), nid(nid), mode(mode), keyLength(keyLength), blockSize(blockSize), ivLength(ivLength) {}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
friend bool operator==(const CipherInfo& lhs, const CipherInfo& rhs) = default;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::crypto
|
|
59
|
+
|
|
60
|
+
namespace margelo::nitro {
|
|
61
|
+
|
|
62
|
+
// C++ CipherInfo <> JS CipherInfo (object)
|
|
63
|
+
template <>
|
|
64
|
+
struct JSIConverter<margelo::nitro::crypto::CipherInfo> final {
|
|
65
|
+
static inline margelo::nitro::crypto::CipherInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
67
|
+
return margelo::nitro::crypto::CipherInfo(
|
|
68
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "name"))),
|
|
69
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nid"))),
|
|
70
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mode"))),
|
|
71
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keyLength"))),
|
|
72
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "blockSize"))),
|
|
73
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ivLength")))
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::crypto::CipherInfo& arg) {
|
|
77
|
+
jsi::Object obj(runtime);
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "name"), JSIConverter<std::string>::toJSI(runtime, arg.name));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "nid"), JSIConverter<double>::toJSI(runtime, arg.nid));
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mode"), JSIConverter<std::string>::toJSI(runtime, arg.mode));
|
|
81
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "keyLength"), JSIConverter<double>::toJSI(runtime, arg.keyLength));
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "blockSize"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.blockSize));
|
|
83
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "ivLength"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.ivLength));
|
|
84
|
+
return obj;
|
|
85
|
+
}
|
|
86
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
87
|
+
if (!value.isObject()) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
jsi::Object obj = value.getObject(runtime);
|
|
91
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "name")))) return false;
|
|
95
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nid")))) return false;
|
|
96
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mode")))) return false;
|
|
97
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "keyLength")))) return false;
|
|
98
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "blockSize")))) return false;
|
|
99
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "ivLength")))) return false;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridArgon2Spec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridArgon2Spec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::crypto {
|
|
11
|
+
|
|
12
|
+
void HybridArgon2Spec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("hash", &HybridArgon2Spec::hash);
|
|
18
|
+
prototype.registerHybridMethod("hashSync", &HybridArgon2Spec::hashSync);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace margelo::nitro::crypto
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridArgon2Spec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
19
|
+
#include <NitroModules/Promise.hpp>
|
|
20
|
+
#include <string>
|
|
21
|
+
#include <optional>
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::crypto {
|
|
24
|
+
|
|
25
|
+
using namespace margelo::nitro;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* An abstract base class for `Argon2`
|
|
29
|
+
* Inherit this class to create instances of `HybridArgon2Spec` in C++.
|
|
30
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
31
|
+
* @example
|
|
32
|
+
* ```cpp
|
|
33
|
+
* class HybridArgon2: public HybridArgon2Spec {
|
|
34
|
+
* public:
|
|
35
|
+
* HybridArgon2(...): HybridObject(TAG) { ... }
|
|
36
|
+
* // ...
|
|
37
|
+
* };
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
class HybridArgon2Spec: public virtual HybridObject {
|
|
41
|
+
public:
|
|
42
|
+
// Constructor
|
|
43
|
+
explicit HybridArgon2Spec(): HybridObject(TAG) { }
|
|
44
|
+
|
|
45
|
+
// Destructor
|
|
46
|
+
~HybridArgon2Spec() override = default;
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
// Properties
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
// Methods
|
|
54
|
+
virtual std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>> hash(const std::string& algorithm, const std::shared_ptr<ArrayBuffer>& message, const std::shared_ptr<ArrayBuffer>& nonce, double parallelism, double tagLength, double memory, double passes, double version, const std::optional<std::shared_ptr<ArrayBuffer>>& secret, const std::optional<std::shared_ptr<ArrayBuffer>>& associatedData) = 0;
|
|
55
|
+
virtual std::shared_ptr<ArrayBuffer> hashSync(const std::string& algorithm, const std::shared_ptr<ArrayBuffer>& message, const std::shared_ptr<ArrayBuffer>& nonce, double parallelism, double tagLength, double memory, double passes, double version, const std::optional<std::shared_ptr<ArrayBuffer>>& secret, const std::optional<std::shared_ptr<ArrayBuffer>>& associatedData) = 0;
|
|
56
|
+
|
|
57
|
+
protected:
|
|
58
|
+
// Hybrid Setup
|
|
59
|
+
void loadHybridMethods() override;
|
|
60
|
+
|
|
61
|
+
protected:
|
|
62
|
+
// Tag for logging
|
|
63
|
+
static constexpr auto TAG = "Argon2";
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
} // namespace margelo::nitro::crypto
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCertificateSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridCertificateSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::crypto {
|
|
11
|
+
|
|
12
|
+
void HybridCertificateSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("verifySpkac", &HybridCertificateSpec::verifySpkac);
|
|
18
|
+
prototype.registerHybridMethod("exportPublicKey", &HybridCertificateSpec::exportPublicKey);
|
|
19
|
+
prototype.registerHybridMethod("exportChallenge", &HybridCertificateSpec::exportChallenge);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
} // namespace margelo::nitro::crypto
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCertificateSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::crypto {
|
|
21
|
+
|
|
22
|
+
using namespace margelo::nitro;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* An abstract base class for `Certificate`
|
|
26
|
+
* Inherit this class to create instances of `HybridCertificateSpec` in C++.
|
|
27
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
28
|
+
* @example
|
|
29
|
+
* ```cpp
|
|
30
|
+
* class HybridCertificate: public HybridCertificateSpec {
|
|
31
|
+
* public:
|
|
32
|
+
* HybridCertificate(...): HybridObject(TAG) { ... }
|
|
33
|
+
* // ...
|
|
34
|
+
* };
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
class HybridCertificateSpec: public virtual HybridObject {
|
|
38
|
+
public:
|
|
39
|
+
// Constructor
|
|
40
|
+
explicit HybridCertificateSpec(): HybridObject(TAG) { }
|
|
41
|
+
|
|
42
|
+
// Destructor
|
|
43
|
+
~HybridCertificateSpec() override = default;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
// Properties
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
// Methods
|
|
51
|
+
virtual bool verifySpkac(const std::shared_ptr<ArrayBuffer>& spkac) = 0;
|
|
52
|
+
virtual std::shared_ptr<ArrayBuffer> exportPublicKey(const std::shared_ptr<ArrayBuffer>& spkac) = 0;
|
|
53
|
+
virtual std::shared_ptr<ArrayBuffer> exportChallenge(const std::shared_ptr<ArrayBuffer>& spkac) = 0;
|
|
54
|
+
|
|
55
|
+
protected:
|
|
56
|
+
// Hybrid Setup
|
|
57
|
+
void loadHybridMethods() override;
|
|
58
|
+
|
|
59
|
+
protected:
|
|
60
|
+
// Tag for logging
|
|
61
|
+
static constexpr auto TAG = "Certificate";
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro::crypto
|
|
@@ -22,6 +22,7 @@ namespace margelo::nitro::crypto {
|
|
|
22
22
|
prototype.registerHybridMethod("setAuthTag", &HybridCipherSpec::setAuthTag);
|
|
23
23
|
prototype.registerHybridMethod("getAuthTag", &HybridCipherSpec::getAuthTag);
|
|
24
24
|
prototype.registerHybridMethod("getSupportedCiphers", &HybridCipherSpec::getSupportedCiphers);
|
|
25
|
+
prototype.registerHybridMethod("getCipherInfo", &HybridCipherSpec::getCipherInfo);
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -15,12 +15,15 @@
|
|
|
15
15
|
|
|
16
16
|
// Forward declaration of `CipherArgs` to properly resolve imports.
|
|
17
17
|
namespace margelo::nitro::crypto { struct CipherArgs; }
|
|
18
|
+
// Forward declaration of `CipherInfo` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::crypto { struct CipherInfo; }
|
|
18
20
|
|
|
19
21
|
#include <NitroModules/ArrayBuffer.hpp>
|
|
20
22
|
#include "CipherArgs.hpp"
|
|
21
23
|
#include <optional>
|
|
22
24
|
#include <string>
|
|
23
25
|
#include <vector>
|
|
26
|
+
#include "CipherInfo.hpp"
|
|
24
27
|
|
|
25
28
|
namespace margelo::nitro::crypto {
|
|
26
29
|
|
|
@@ -61,6 +64,7 @@ namespace margelo::nitro::crypto {
|
|
|
61
64
|
virtual bool setAuthTag(const std::shared_ptr<ArrayBuffer>& tag) = 0;
|
|
62
65
|
virtual std::shared_ptr<ArrayBuffer> getAuthTag() = 0;
|
|
63
66
|
virtual std::vector<std::string> getSupportedCiphers() = 0;
|
|
67
|
+
virtual std::optional<CipherInfo> getCipherInfo(const std::string& name, std::optional<double> keyLength, std::optional<double> ivLength) = 0;
|
|
64
68
|
|
|
65
69
|
protected:
|
|
66
70
|
// Hybrid Setup
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridDhKeyPairSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridDhKeyPairSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::crypto {
|
|
11
|
+
|
|
12
|
+
void HybridDhKeyPairSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("generateKeyPair", &HybridDhKeyPairSpec::generateKeyPair);
|
|
18
|
+
prototype.registerHybridMethod("generateKeyPairSync", &HybridDhKeyPairSpec::generateKeyPairSync);
|
|
19
|
+
prototype.registerHybridMethod("setPrimeLength", &HybridDhKeyPairSpec::setPrimeLength);
|
|
20
|
+
prototype.registerHybridMethod("setPrime", &HybridDhKeyPairSpec::setPrime);
|
|
21
|
+
prototype.registerHybridMethod("setGenerator", &HybridDhKeyPairSpec::setGenerator);
|
|
22
|
+
prototype.registerHybridMethod("getPublicKey", &HybridDhKeyPairSpec::getPublicKey);
|
|
23
|
+
prototype.registerHybridMethod("getPrivateKey", &HybridDhKeyPairSpec::getPrivateKey);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
} // namespace margelo::nitro::crypto
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridDhKeyPairSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
#include <NitroModules/Promise.hpp>
|
|
19
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::crypto {
|
|
22
|
+
|
|
23
|
+
using namespace margelo::nitro;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* An abstract base class for `DhKeyPair`
|
|
27
|
+
* Inherit this class to create instances of `HybridDhKeyPairSpec` in C++.
|
|
28
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
29
|
+
* @example
|
|
30
|
+
* ```cpp
|
|
31
|
+
* class HybridDhKeyPair: public HybridDhKeyPairSpec {
|
|
32
|
+
* public:
|
|
33
|
+
* HybridDhKeyPair(...): HybridObject(TAG) { ... }
|
|
34
|
+
* // ...
|
|
35
|
+
* };
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
class HybridDhKeyPairSpec: public virtual HybridObject {
|
|
39
|
+
public:
|
|
40
|
+
// Constructor
|
|
41
|
+
explicit HybridDhKeyPairSpec(): HybridObject(TAG) { }
|
|
42
|
+
|
|
43
|
+
// Destructor
|
|
44
|
+
~HybridDhKeyPairSpec() override = default;
|
|
45
|
+
|
|
46
|
+
public:
|
|
47
|
+
// Properties
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
// Methods
|
|
52
|
+
virtual std::shared_ptr<Promise<void>> generateKeyPair() = 0;
|
|
53
|
+
virtual void generateKeyPairSync() = 0;
|
|
54
|
+
virtual void setPrimeLength(double primeLength) = 0;
|
|
55
|
+
virtual void setPrime(const std::shared_ptr<ArrayBuffer>& prime) = 0;
|
|
56
|
+
virtual void setGenerator(double generator) = 0;
|
|
57
|
+
virtual std::shared_ptr<ArrayBuffer> getPublicKey() = 0;
|
|
58
|
+
virtual std::shared_ptr<ArrayBuffer> getPrivateKey() = 0;
|
|
59
|
+
|
|
60
|
+
protected:
|
|
61
|
+
// Hybrid Setup
|
|
62
|
+
void loadHybridMethods() override;
|
|
63
|
+
|
|
64
|
+
protected:
|
|
65
|
+
// Tag for logging
|
|
66
|
+
static constexpr auto TAG = "DhKeyPair";
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
} // namespace margelo::nitro::crypto
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridDsaKeyPairSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridDsaKeyPairSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::crypto {
|
|
11
|
+
|
|
12
|
+
void HybridDsaKeyPairSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("generateKeyPair", &HybridDsaKeyPairSpec::generateKeyPair);
|
|
18
|
+
prototype.registerHybridMethod("generateKeyPairSync", &HybridDsaKeyPairSpec::generateKeyPairSync);
|
|
19
|
+
prototype.registerHybridMethod("setModulusLength", &HybridDsaKeyPairSpec::setModulusLength);
|
|
20
|
+
prototype.registerHybridMethod("setDivisorLength", &HybridDsaKeyPairSpec::setDivisorLength);
|
|
21
|
+
prototype.registerHybridMethod("getPublicKey", &HybridDsaKeyPairSpec::getPublicKey);
|
|
22
|
+
prototype.registerHybridMethod("getPrivateKey", &HybridDsaKeyPairSpec::getPrivateKey);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
} // namespace margelo::nitro::crypto
|