QA/Signed Text: Difference between revisions
< QA
Jump to navigation
Jump to search
(New page: Here is some sample code that will show how the crypto.signText() function works in Firefox. <pre> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml...) |
No edit summary |
||
| Line 1: | Line 1: | ||
==Background== | |||
Here is some sample code that will show how the crypto.signText() function works in Firefox. | Here is some sample code that will show how the crypto.signText() function works in Firefox. | ||
==UI== | |||
[[Image:SignText01.png]] | |||
==Code Sample== | |||
<pre> | <pre> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
| Line 57: | Line 62: | ||
</pre> | </pre> | ||
==Links== | |||
http://docs.sun.com/source/816-6152-10/sgntxt.htm | |||
Revision as of 03:49, 6 September 2008
Background
Here is some sample code that will show how the crypto.signText() function works in Firefox.
UI
Code Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Author" content="Bob Lord" />
<script type="text/javascript">
var shoppingCart = "Bill of Sale\n--------------------\n\
3 Tires $300.00\n\
1 Axle $795.00\n\
2 Bumpers $500.00\n\
--------------------\n\
Total Price $1595.00";
function submitMyForm() {
var element = document.getElementById('mytext');
element.innerHTML=crypto.signText(shoppingCart,"ask");
}
</script>
<title>
Form Signing Example
</title>
</head>
<body>
<p>
<b>Shopping Check Out</b>
</p>
<p>
Your shopping cart has the following items in it:
</p>
<pre>
<script type="text/javascript">
document.write(shoppingCart);
</script>
</pre>
<p>
If you are ready to check out, click here to digitally sign the order and to submit it.
</p>
<form id="input" onclick="submitMyForm();" action="#">
<input type="submit" value="Submit my order!" />
</form><br />
<hr />
<p>
This is what the server will see:
</p>
<div id="mytext2"
style="font-family:monospace; display:table; font-size:8pt; padding: 5px; border:thin solid;">
<pre id="mytext">Signed text will show up here.</pre>
</div>
<p>
</p>
</body>
</html>
