summaryrefslogtreecommitdiff
path: root/school/node_modules/node-forge/tests/keygen.html
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-01-10 14:54:04 +0100
committerMinteck <contact@minteck.org>2023-01-10 14:54:04 +0100
commit99c1d9af689e5325f3cf535c4007b3aeb8325229 (patch)
treee663b3c2ebdbd67c818ac0c5147f0ce1d2463cda /school/node_modules/node-forge/tests/keygen.html
parent9871b03912fc28ad38b4037ebf26a78aa937baba (diff)
downloadpluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.tar.gz
pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.tar.bz2
pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.zip
Update - This is an automated commit
Diffstat (limited to 'school/node_modules/node-forge/tests/keygen.html')
-rw-r--r--school/node_modules/node-forge/tests/keygen.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/school/node_modules/node-forge/tests/keygen.html b/school/node_modules/node-forge/tests/keygen.html
new file mode 100644
index 0000000..22e2432
--- /dev/null
+++ b/school/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>