I'm not java expert, but I think function String2Base64 also need to be
included in signForm.js. This function is available it HTML form signing
example at http://downloads.mozdev.org/secclab/common/SignString.html

On Thu, Dec 18, 2003 at 05:01:34PM +0100, Michael Bell wrote:
> From: Michael Bell <[EMAIL PROTECTED]>
> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3.1) Gecko/20030609
> To: [EMAIL PROTECTED]
> Subject: Re: [Openca-Users] Signing Request mozilla/secclab
> Reply-To: [EMAIL PROTECTED]
> Date: Thu, 18 Dec 2003 17:01:34 +0100
> 
> Hi Alexei, hi Oli,
> 
> an adapted version of signFormN in signForm.js could look like this (0.9.2):
> 
> function signFormN(theForm, theWindow) {
>   var signedText;
> 
>   var sObject;
>   var result;
>   try {
>     sObject = new CLABSignString();
>     if (sObject == undefined) alert('SecCLAB Plugin failed.');
>     var status = {value:0};
>     var len = {value:0};
>     try {
>       result = 
> sObject.signString(window,theForm.text.value,theForm.text.value.length,status,len);
>       if (status.value != sObject.STATUS_OK) {
>         alert("Aborted by user or no valid user certificate");
>         return false;
>       }
>     } catch(ex) {
>         alert("Aborted by user or no valid user certificate");
>         return false;
>     }
>     signedText = String2Base64(result); //String2Hex(result);
>   } catch(ex) {
>     signedText = theWindow.crypto.signText(theForm.text.value, "ask");
>   }
> 
>   if ( signedText.length < 100 ) {
>     alert( "Sign is needed to proceed!" );
>     return false;
>   }
> 
>   theForm.signature.value = signedText;
> }
> 
> Be warned, I have no SecCLAB plugin and I don't tested this code. It is 
> only an idea to help the guys which have not so much OpenCA experience 
> like me :)
> 
> Perhaps there should be some error detection for crypto too.
> 
> Best regards
> 
> Michael
> -- 
> -------------------------------------------------------------------
> Michael Bell                   Email: [EMAIL PROTECTED]
> ZE Computer- und Medienservice            Tel.: +49 (0)30-2093 2482
> (Computing Centre)                        Fax:  +49 (0)30-2093 2704
> Humboldt-University of Berlin
> Unter den Linden 6
> 10099 Berlin                   Email (private): [EMAIL PROTECTED]
> Germany                                       http://www.openca.org
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
> Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> Openca-Users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/openca-users

-- 
Alexei Chetroi

UniFlux Line
Chisinau, MD2001, Moldova
bd. Stefan cel Mare, 69/1, et 3
Tel: +3732-278-376
Fax: +3732-278-398
GSM: +3739-111-893
e-mail: [EMAIL PROTECTED]
http://www.uniflux-line.net



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Openca-Users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/openca-users

Reply via email to