SignDataP7.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"-->
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
  7. <title></title>
  8. <!-- 전자인증 모듈 설정 //-->
  9. <link rel="stylesheet" type="text/css" href="../CC_WSTD_home/unisignweb/rsrc/css/certcommon.css?v=1"/>
  10. <script type="text/javascript" src="../CC_WSTD_home/unisignweb/js/unisignwebclient.js?v=1"></script>
  11. <script type="text/javascript" src="./UniSignWeb_Multi_Init_Nim.js?v=1"></script>
  12. <!-- 전자인증 모듈 설정 //-->
  13. <script>
  14. function SignData()
  15. {
  16. if (document.frm.plainText.value == "")
  17. {
  18. alert("서명할 원문이 없습니다.");
  19. return;
  20. }
  21. unisign.SignDataEx( document.frm.plainText.value, null,function(resultObject)
  22. {
  23. if ( null == resultObject || '' == resultObject )
  24. {
  25. unisign.GetLastError(
  26. function(errCode, errMsg)
  27. {
  28. alert('Error code : ' + errCode + '\n\nError Msg : ' + errMsg);
  29. }
  30. );
  31. }
  32. else
  33. {
  34. document.frm.signedText.value = resultObject.signedData;
  35. alert(resultObject.certAttrs.subjectName);//인증서 이름
  36. }
  37. });
  38. }
  39. function Send()
  40. {
  41. if (document.frm.signedText.value == "")
  42. {
  43. alert("전자서명값이 없습니다.");
  44. }
  45. document.frm.method = "post";
  46. document.frm.action = "verifySignData.jsp";
  47. document.frm.submit();
  48. }
  49. </script>
  50. </head>
  51. <body>
  52. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  53. <tr>
  54. <td height="37" bgcolor="#0099CC">
  55. &nbsp;<font color="#FFFFFF"><b>[전자서명 페이지]</b></font>
  56. </td>
  57. </tr>
  58. </table>
  59. <h3><font color="red"> hidden 처리 대상 : 원문, 전자서명값<br>
  60. <br>
  61. 브라우저사인+HDD+USB</font></h3>
  62. <br>
  63. form 속성에 onsubmit="return false" 을 설정해야 함 <br>
  64. <form name="frm" onsubmit="return false">
  65. <table cellpadding="0" cellspacing="0" width="100%" align="center">
  66. <tr>
  67. <td align="center">
  68. <br>
  69. <br>
  70. <br>
  71. 원문<br>
  72. <textarea name="plainText" rows="5" cols="40">test 123</textarea>
  73. <br>
  74. <input type="button" value="전자서명(인증서선택)" onclick="javascript:SignData();">
  75. </td>
  76. <td align="center">
  77. <br>
  78. <br>
  79. <br>
  80. 전자서명값<br>
  81. <textarea name="signedText" rows="5" cols="40"></textarea>
  82. <br>
  83. <input type=button value="전송(verifySignData.jsp)" onclick="Send();">
  84. </td>
  85. </tr>
  86. </table>
  87. </form>
  88. </body>
  89. </html>