Question

I'm trying to sign a form on clientside and sending it to the server to verify.

I'm using the crypto.signText() however when i submit the form it doesn't ask to choose a certificate.

this is my code:

signature = theWindow.crypto.signText(res, "ask");
Was it helpful?

Solution

Appears this is highly browser dependent.

Best way to sign data in web form with user certificate

Therefore you might be best using a java applet instead of doing signing in javascript.

OTHER TIPS

http://docs.oracle.com/cd/E19957-01/816-6152-10/contents.htm

There is a caOption parameter:

resultString = [window.]crypto.signText(stringToSign, caOption, [caNameString1, [caNameString2, . . . ]])

Are you writing the text to instantiate the prompt?

<html> 
<head> 
<script> 
var foo = crypto.signText("Bill of Sale\n--------------------\n3 Tires      $300.00\n1 Axle       $795.00\n2 Bumpers    $500.00\n--------------------\nTotal Price $1595.00", "ask"); 
</script> 
</head> 
<body> 
This is an HTML page<p> 
<script> 
document.write(foo); 
</script> 
</body> 
</html> 

In order to have the crypto.signText working, you need to import your certificate in the browser certificate library.

In Firefox, go to preferences, advanced, Certificates.

Import you .p12 certificate file. You might also edit the trust details from the server certificate.

I don't get it 100% working yet, but it already ask me for the certificate to use (proposing the imported certificate), and for the password. unfortunately, the password is not acepted, but it might be because my server certificate is a self made one, not reachable (yet) by the browser.

interesting link (in spanish). http://www.adictosaltrabajo.com/tutoriales/tutoriales.php?pagina=FirmasFirefox

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top