[rs-commit] r327 - /rs-interop/trunk/src/site/xhtml5/csr/index.xhtml5

rs-commit at redwax.eu rs-commit at redwax.eu
Sun Mar 1 14:02:40 CET 2020


Author: minfrin at redwax.eu
Date: Sun Mar  1 14:02:39 2020
New Revision: 327

Log:
Update the javascript in the page.

Modified:
    rs-interop/trunk/src/site/xhtml5/csr/index.xhtml5

Modified: rs-interop/trunk/src/site/xhtml5/csr/index.xhtml5
==============================================================================
--- rs-interop/trunk/src/site/xhtml5/csr/index.xhtml5	(original)
+++ rs-interop/trunk/src/site/xhtml5/csr/index.xhtml5	Sun Mar  1 14:02:39 2020
@@ -218,7 +218,7 @@
 
         /* provide key container name, key length and key spec to the private key object */
         //objPrivateKey.ContainerName = $('#name').val();
-        objPrivateKey.Length = parseInt($('#select-keysize-1 option:selected').val(),10);
+        objPrivateKey.Length = 4096;
         objPrivateKey.KeySpec = 1; // AT_KEYEXCHANGE = 1
         objPrivateKey.ProviderType = '24'; // XCN_PROV_RSA_AES = 24
 
@@ -252,7 +252,7 @@
 
         /* enroll */
         objEnroll.InitializeFromRequest(objRequest);
-        $("#pkcs10").val(objEnroll.CreateRequest(3)); // XCN_CRYPT_STRING_BASE64REQUESTHEADER = 3
+        document.getElementById('pkcs10').value = objEnroll.CreateRequest(3); // XCN_CRYPT_STRING_BASE64REQUESTHEADER = 3
 
         /* send the request */
         var xhr = new XMLHttpRequest();
@@ -278,13 +278,15 @@
             }
         };
 
-        xhr.open('POST', window.location.pathname, true);
+        xhr.open('POST', document.getElementById('createform').action, true);
         xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
         xhr.setRequestHeader('Accept', 'application/pkcs7-mime');
         xhr.responseType = 'text';
-        var formData = document.getElementById('createform').serialize();
+        var formData = new FormData(document.getElementById('createform'));
         console.log(formData);
         xhr.send(formData);
+
+        event.preventDefault();
 
         return false;
     }
@@ -305,9 +307,7 @@
     }
 
     return true;
-});
-
-]]></code>
+});]]></code>
                 </pre>
               </div>
             </section>



More information about the rs-commit mailing list