summaryrefslogtreecommitdiff
path: root/alarm/node_modules/node-forge/tests/keygen.html
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-10-18 08:59:09 +0200
committerMinteck <contact@minteck.org>2022-10-18 08:59:09 +0200
commit2c4ae43e688a9873e86211ea0e7aeb9ba770dd77 (patch)
tree17848d95522dab25d3cdeb9c4a6450e2a234861f /alarm/node_modules/node-forge/tests/keygen.html
parent108525534c28013cfe1897c30e4565f9893f3766 (diff)
downloadpluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.gz
pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.bz2
pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.zip
Update
Diffstat (limited to 'alarm/node_modules/node-forge/tests/keygen.html')
-rw-r--r--alarm/node_modules/node-forge/tests/keygen.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/alarm/node_modules/node-forge/tests/keygen.html b/alarm/node_modules/node-forge/tests/keygen.html
new file mode 100644
index 0000000..22e2432
--- /dev/null
+++ b/alarm/node_modules/node-forge/tests/keygen.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <script type="text/javascript" src="forge/util.js"></script>
+ <script type="text/javascript" src="forge/sha256.js"></script>
+ <script type="text/javascript" src="forge/cipher.js"></script>
+ <script type="text/javascript" src="forge/cipherModes.js"></script>
+ <script type="text/javascript" src="forge/aes.js"></script>
+ <script type="text/javascript" src="forge/prng.js"></script>
+ <script type="text/javascript" src="forge/random.js"></script>
+ <script type="text/javascript" src="forge/jsbn.js"></script>
+ <script type="text/javascript" src="forge/asn1.js"></script>
+ <script type="text/javascript" src="forge/pem.js"></script>
+ <script type="text/javascript" src="forge/rsa.js"></script>
+</head>
+
+<body>
+
+<script type="text/javascript">
+
+function async() {
+ var bits = 2048;
+ console.log('Generating ' + bits + '-bit key-pair...');
+ var st = +new Date();
+ forge.pki.rsa.generateKeyPair({
+ bits: bits,
+ workers: -1,
+ /*workLoad: 100,*/
+ workerScript: 'forge/prime.worker.js'
+ }, function(err, keypair) {
+ var et = +new Date();
+ console.log('Key-pair created in ' + (et - st) + 'ms.');
+ //console.log('private', forge.pki.privateKeyToPem(keypair.privateKey));
+ //console.log('public', forge.pki.publicKeyToPem(keypair.publicKey));
+ });
+}
+
+function sync() {
+ var bits = 2048;
+ console.log('Generating ' + bits + '-bit key-pair...');
+ var st = +new Date();
+ var keypair = forge.pki.rsa.generateKeyPair(bits);
+ var et = +new Date();
+ console.log('Key-pair created in ' + (et - st) + 'ms.');
+ //console.log('private', forge.pki.privateKeyToPem(keypair.privateKey));
+ //console.log('public', forge.pki.publicKeyToPem(keypair.publicKey));
+}
+
+async();
+//sync();
+
+</script>
+
+</body>
+</html>