SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot abstraktmedia's Avatar
    Join Date
    Feb 2004
    Location
    Ljubljana
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Digital signatures and php(5)

    Hi guys...

    I got this big project today.The application itself is not that complicated but the aplication should have checking of digital signatures...The signatures will be published by our state agency but I have no clue where to start.How can this be done in php? What do I need?What's the concept?...

    Any help would be really really appriciated....
    exit(0);

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    be more clear about what u need......
    for what is that digital signatures?

  3. #3
    SitePoint Zealot abstraktmedia's Avatar
    Join Date
    Feb 2004
    Location
    Ljubljana
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @reminder: You have a PM!

    I have a database of 300 people...they all should apply with our goverment agency to issue them a certificat with whome they will be able to use the application...but I have no experience with certificates or signatures and don't know where to start....how can I (technically) sort this out?...
    exit(0);

  4. #4
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  5. #5
    SitePoint Zealot abstraktmedia's Avatar
    Join Date
    Feb 2004
    Location
    Ljubljana
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi...yes I was looking at those functions but I still have a "logic" problem...I have an authority who will issue digital signatures to each person....and I will somehow have to check if that digital signature is ok....so openSSL functions should be enough for that?just so I know that I'm on the right track....thanx to all...
    exit(0);

  6. #6
    SitePoint Zealot abstraktmedia's Avatar
    Join Date
    Feb 2004
    Location
    Ljubljana
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone? Nobody ever worked with PHP and digital signatures?...woow...am I the first?
    exit(0);

  7. #7
    get into it! bigduke's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well ahem! I was supposed to work on an app that uses them but never got around using them yet since the app is still in its feasibility analysis stage.

    Never thought of OpenSSL functions but yeah all you need to do is verify the signature's info and then carry out whatever processing you need to based on that.

    PHP Code:
    //FROM THE PHP MANUAL
    <?php
    // $data and $signature are assumed to contain the data and the signature

    // fetch public key from certificate and ready it
    $fp fopen("/src/openssl-0.9.6/demos/sign/cert.pem""r");
    $cert fread($fp8192);
    fclose($fp);
    $pubkeyid openssl_get_publickey($cert);

    // state whether signature is okay or not
    $ok openssl_verify($data$signature$pubkeyid);
    if (
    $ok == 1) {
       echo 
    "good";
    } elseif (
    $ok == 0) {
       echo 
    "bad";
    } else {
       echo 
    "ugly, error checking signature";
    }
    // free the key from memory
    openssl_free_key($pubkeyid);
    ?>
    Last edited by bigduke; Jun 2, 2005 at 09:19.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •