Hello,

Can anyone help with this, but I am totally stuck on a project!  I have
some code from a VBScript that reads as follows:

$html .=  <<EOF ;
<OBJECT CLASSID="clsid:43F8F289-7A20-11D0-8F06-00C04FC295E1"
        CODEBASE="http://www.acaci.com/dll/xenroll.dll"
        ID=Enroll>
</OBJECT>

<FORM NAME="CertReqForm"
      ACTION="https://www.acaci.com/cgi-bin/cgi-bin-442/treatReq.cgi"
      METHOD=POST>
Your Name:                              <INPUT NAME="CommonName"
value=""><P>   
Your Email address:                     <INPUT NAME="EmailAddress"
value=""><P>
Your Division/Department:               <INPUT NAME="OrganizationalUnit"
value=""><P>

<INPUT TYPE="BUTTON" VALUE="Submit your certificate request"
       ONCLICK="Submit_OnClick" LANGUAGE="VBScript">
<INPUT TYPE="hidden" NAME="SessionId" VALUE="$SessionId">
<INPUT TYPE="hidden" NAME="ms_req" VALUE="">
</FORM>

<SCRIPT LANGUAGE="VBScript">
 
Sub Submit_OnClick
  
  Dim TheForm
  Dim sz10
  Dim szName
        
  Set TheForm = document.CertReqForm

  szName        = "C=US; S=Arizona; L=Clarkdale; O=Yavapai-Apache
Nation; OU="       & _
                  TheForm.OrganizationalUnit.value & "; CN="     & _
                  TheForm.CommonName.value                       & _ 
                  "; 1.2.840.113549.1.9.1="                      & _
                  TheForm.EmailAddress.value

  Enroll.KeySpec = 1
  Enroll.GenKeyFlags = 3
  sz10 = Enroll.CreatePKCS10(szName,"1.3.6.1.5.5.7.3.2")
       
  if (sz10 = Empty OR theError <> 0) Then
    sz = "The error '" & Hex(theError) & "' occurred."    & _
         chr(13) & chr(10)                                & _
         "Your credentials could not be generated."
    result = MsgBox(sz, 0, "Credentials Enrollment")
 
    Exit Sub
  else
    TheForm.ms_req.value = sz10
    TheForm.submit()
  end if
        
End Sub

</SCRIPT>

The form values from this script are sent to another script for
processing.  The snippet that works on this particular output is as
follows:

    $req = $input{'ms_req'} ;  
    mkdir("/usr/local/ssl/acaci/msiereqs/$sessionId",0777) ;
    chmod 0777, "/usr/local/ssl/acaci/msiereqs/$sessionId" ;
   
open(CERT,">/usr/local/ssl/acaci/msiereqs/$sessionId/req.raw.$msversion")
;
    print CERT $req ;
    close(CERT) ;
    $req =~ s/\r//g ;
    $req =~ s/([^\n]{72,72})\n([^\n]{1,71})\n([^\n]{1,71})$/$1\n$2$3/ ;
    open(CERT,">/usr/local/ssl/acaci/msiereqs/$sessionId/req") ;
    print CERT "$req\n" ;
    close(CERT) ;
  }

What I am trying to go is convert the DER format file 'req' here to PEM
format, sign it with a CA certificate (that I created using instructions
in Chapter 6 of the mod-ssl manual), and then convert the signed
certificate to PKCS12 format for Internet Explorer.

I have been trying to convert from DER to PEM with the statement:

../bin/openssl base64 -d < req | req -inform der -text > req.pem

from a shell script, but keep coming up with errors.

I saw in Chapter 6 of the mod-ssl manual where I can convert from PEM to
DER, but is there a direct way to convert a file generated with the
xenroll.dll/createPKCS10 combination (I believe it is in DER format) to
PEM format?

Any help with this will be greatly appreciated!  Please reply via
e-mail, since I am not sure that I am a member of the
[EMAIL PROTECTED] mailing list.  I do not think that I am, so if
someone could tell me how to subscribe, this would also be helpful.

Thanks you,
Murrah Boswell
[EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to