home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2005 March / PCWELT_3_2005.ISO / pcwsoft / framework-2.2.exe / set_cert_and_key.al < prev    next >
Encoding:
Text File  |  2004-02-17  |  812 b   |  24 lines

  1. # NOTE: Derived from blib/lib/Net/SSLeay.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Net::SSLeay;
  5.  
  6. #line 1898 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/set_cert_and_key.al)"
  7. ###
  8. ### Easy set up of private key and certificate
  9. ###
  10.  
  11. sub set_cert_and_key ($$$) {
  12.     my ($ctx, $cert_path, $key_path) = @_;    
  13.     my $errs = '';
  14.     # Following will ask password unless private key is not encrypted
  15.     CTX_use_RSAPrivateKey_file ($ctx, $key_path, &FILETYPE_PEM);
  16.     $errs .= print_errs("private key `$key_path' ($!)");
  17.     CTX_use_certificate_file ($ctx, $cert_path, &FILETYPE_PEM);
  18.     $errs .= print_errs("certificate `$cert_path' ($!)");
  19.     return wantarray ? (undef, $errs) : ($errs eq '');
  20. }
  21.  
  22. # end of Net::SSLeay::set_cert_and_key
  23. 1;
  24.