Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Using Certificate files in Perl

by shug94 (Sexton)
on Oct 19, 2009 at 00:51 UTC ( #801915=perlquestion: print w/ replies, xml ) Need Help??
shug94 has asked for the wisdom of the Perl Monks concerning the following question:

I have a certificate file which was generated by the simpleCA tool. I want to know what the easiest way is to use this certificate file to sign some data in Perl.

I am running an Apache HTTP Server on a Centos box, and I need to digitally sign some text.

I read in the file (Client.crt), and output it to standard output. It appears to be Base64Encoded. Here is a sample:
-----BEGIN CERTIFICATE----- MIICqzCCAhSgAwIBAgICEAAwDQYJKoZIhvcNAQEEBQAwgZwxCzAJBgNVBAYTAkFV ... EmsqLqgiS/OejqRYmaJe -----END CERTIFICATE-----


Is there a Perl module which will read in this certificate file and allow me to use it to sign data?

Cheers,
Shug

Comment on Using Certificate files in Perl
Download Code
Re: Using Certificate files in Perl
by Anonymous Monk on Oct 19, 2009 at 02:48 UTC
      I clearly didn't ask my question well enough.

      I will probably be wanting to sign it using Crypt::RSA, but what I really need to know is how to retrieve the public and private keys from the certificate file. Although I suppose this is not really a perl question, and is more of a simpleCA question. I will try elsewhere on the net.

      I have now read the file further using the decode function of MIME::Base64, and it seems to contain some plaintext and a lot of binary. Now all I need is to understand the format.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://801915]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-09-23 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls