read from file commands???

This is a discussion on read from file commands??? within the Linux Programming forums, part of the Platform Specific Boards category; I'm using OpenSSL(an application in Linux OS) to setup a Certification Authority (CA). I have setup the CA and I'm ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    5

    Unhappy read from file commands???

    I'm using OpenSSL(an application in Linux OS) to setup a Certification Authority (CA). I have setup the CA and I'm also able to create Digital Certificates. Users need to input their details interactively / line by line because OpenSSL is command lines only.
    My problem is, I want to create an interface so that users need not input theirs details interactively, all they need to do is just fill in the form and click submit. When submit is clicked, the input data will be written to a text file.
    And when another button is clicked, OpenSSL must read from the text file and create the Digital Certificate. How can i do this task? Or please give me any ideas how to replace the command lines with an interface.

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    202
    If I were to impliment this, I would use perl.

    Make your form in html, asking for the fields that you need, and have a perl program grab those parameters, and ten use back-quotes and variable substitution when executing OpenSSL. This should let you bypass writing to the file, and avoid unnecessary overhead while giving your users the simplicity that they'll need.

    Hope this helps.

    --starX
    www.axisoftime.com

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,333
    After creating your text file, then something simple like

    system( "openssl < file.txt > results.log 2>errors.log" );

    should work (providing it reads stdin, and not the terminal directly).

    stdout and stderr are redirected to log files for later use.

    Or perhaps something like this
    http://packages.debian.org/unstable/...rs/expect.html
    would help, if the interaction is particularly complicated.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  2. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  3. c script help to read a file & update
    By indy in forum C Programming
    Replies: 8
    Last Post: 12-01-2003, 10:32 AM
  4. How to convert char read from file into string
    By cruxxe in forum C Programming
    Replies: 7
    Last Post: 05-22-2002, 02:09 PM
  5. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 09:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21