WSRF-Lite

 view release on metacpan or  search on metacpan

lib/WSRF/Lite.pm  view on Meta::CPAN


	eval { require Crypt::OpenSSL::RSA };
	die "Failed to access class Crypt::OpenSSL::RSA: $@" if $@;

	my $key_file_name =
	  $ENV{HTTPS_KEY_FILE} ? $ENV{HTTPS_KEY_FILE} : die "No Private Key\n";
	open( PRIVKEY, $key_file_name )
	  || die("Could not open file $key_file_name");
	my $privkey = join "", <PRIVKEY>;
	close(PRIVKEY);
	Crypt::OpenSSL::RSA->new_private_key($privkey);
}

#returns the cert block between the begin and end delimiters
sub load_cert {

	if ( defined($WSRF::WSS::pub_key) ) {
		if ( ref($WSRF::WSS::pub_key) eq 'CODE' ) {
			return $WSRF::WSS::pub_key->();
		} else {
			return $WSRF::WSS::pub_key;

test/signature_checker.pl  view on Meta::CPAN

# The following lines shows another apporach to setting the cert and key
# information.  $WSRF::WSS::priv_key and $WSRF::WSS::pub_key can point to
# the actual values for the $WSRF::WSS::priv_key and $WSRF::WSS::pub_key
# or as shown below they can point to subroutines that return the actual
# values
#
#$WSRF::WSS::priv_key = sub {
#   open  (PRIV , $ENV{HOME}."/.globus/userkey.pem") or die "Cannot open priv\n";
#    my $priv = join "", <PRIV>;
#   close PRIV;
#   Crypt::OpenSSL::RSA->new_private_key($priv);
#};
#
#$WSRF::WSS::pub_key = sub {
#    open(CERT, $ENV{HOME}."/.globus/usercert.pem") ||
#              die("Could not open certificate file ".$ENV{HOME}."/.globus/usercert.pem" );
#    my $start=0;
#    my $cert="";
#    while (<CERT>) {
#        if (!m/-----END CERTIFICATE-----/ && $start==1) {
#            $cert = $cert . $_;



( run in 0.259 second using v1.01-cache-2.11-cpan-a5abf4f5562 )