NAME

Cog::Security::Myproxy - Perl extension for interacting with a Myproxy server.


SYNOPSIS

  use Cog::Security::Myproxy;


EXAMPLES

  use Cog::Security::Myproxy;
  my $mp = Cog::Security::Myproxy->new(server=>$server);
  my $init = $mp->init(
                username=>$user,
                passphrase=>$l_pass,
                myproxy_passphrase=>$my_pass,       
                cert=>$cert,
                key=>$key
                    );
  my $result = $mp->get_delegation(username=>$user,
                                 passphrase=>$my_pass,
                                 out=>$proxy_file);
  my @out = $mp->info(username=>$user, proxy=>$proxy_file);
  my $change = $mp->change_pass_phrase(username=>$user,
                  old_passphrase=>$opass,
                  new_passphrase=>$npass);
  my @destroy = $mp->destroy(username=>$user,
                           proxy=>$proxy_file);


DESCRIPTION

 This allows you to interact from perl with a myproxy server that
 is already running. It allows you to put a proxy on the server,
 get a proxy from the server, change passphrase, get info on your
 stored credential, and destory a proxy on the server.


AUTHORS

Maytal Dahan, maytal@tacc.utexas.edu Catherine Mills, cmills@sdsc.edu Stephen Mock, mock@sdsc.edu


SUBROUTINES

new()

        Description/Usage:
        Unsed to instantiate a myproxy object with parameters describing the 
        myproxy server.
        $myproxy = Cog::Security::Myproxy->new(
                server=>$server,
                [port=>$port] );
        Required Arguments:
                server - the hostname of the myproxy server (myproxy.yourdomain.edu)
        
        Optional Arguments:
                port - the port that the myproxy server is running on. if not specified
                        it uses the default port
        Returns: a Cog::Security::Myproxy object or undef

get_error()

        Description/Usage:
        Used to return error messages set within the Myproxy object.
        It clears the stored error messages as it returns the string.
        $myproxy = Cog::Security::Myproxy->new( server=>$server);
        $myproxy->get_delegation( bad input etc.... );
        $error = $myproxy->get_error();

init()

        Description/Usage:
        Used to gather a delegated proxy credential from a Myproxy server.
        $myproxy = Cog::Security::Myproxy->new(
                server=>$server
                );
        my $init = $myproxy->init(
                username=>$username,
                passphrase=>$local_passphrase,
                myproxy_passphrase=>$myproxy_passphrase,
                key=>$path_to_keyfile,
                cert=>$path_to_certfile
                );
        if(defined($init)) { print "yay!\n$init"; }
        else { print $mp->get_error(); }
        Required Arguments:
                username - the myproxy username used to store the credential
                cert - the path to the certificate to be used
                key  - the path to the keyfile to be used
                passphrase - the passphrase to the cert and keyfile used to
                        generate a proxy credential
                myproxy_passphrase - the passphrase used to store the credential in
                        the myproxy server
        Optional Arguments:
                cred_lifetime - <hours>    Lifetime of delegated proxy on
                        server (default 1 week)
                proxy_lifetime - <hours>    Lifetime of proxies delegated by
                        server (default 2 hours)
        Returns:
                -on success: a scalar containing a message like:
                "A proxy valid for 168 hours (7.0 days) for user mock now exists 
                 on wintermute.sdsc.edu."
                -on failure: undef (undefined)
        Side Effects:
                -on failure, call $myproxy->get_error() to receive an error
                 message.

get_delegation()

        Description/Usage:
        Used to gather a delegated proxy credential from a Myproxy server.
        $myproxy = Cog::Security::Myproxy->new(
                server=>$server
                );
        my $proxyfile = $myproxy->get_delegation(
                username=>$username,
                passphrase=>$myproxy_passphrase,
                out=>'/home/portal/proxies/$user.proxy'
                );
        Required Arguments: (description below)
                username, passphrase
                        or
                auth_cred
        Optional Arguments:
                username - the myproxy username used to store the credential
                passphrase - the passphrase used to store the credential in 
                        the myproxy server
                out - the location to create the delegated credential in
                    -if not specified, this will be put in /tmp/x509up_u[uid]
                lifetime - the time in hours that the credential will be valid for
                auth_cred - set this to the authorization credential to use to 
                        authenticate to the myproxy server (instead of passphrase)
                DN - if set to 'true', then the DN of the auth_cred will be used
        Returns: 
                -on success: a scalar containing the location of the proxy 
                -on failure: undef (undefined)
        Side Effects:
                -on failure, call $myproxy->get_error() to receive an error
                 message.

info()

        Description/Usage:
        Used to get information about a credential stored in a myproxy server.
        $myproxy = Cog::Security::Myproxy->new(
                server=>$server
                );
        my @out = $myproxy->info(
                username=>$username,
                proxy=>$path_to_proxyfile,
                );
        Required Arguments:
                username - the username associated with the credential in
                        the myproxy server
                proxy - the full path to a live proxy file
        Optional Arguments:
        Returns:
                -on success: an array with the information about the proxy
                -on failure: undef (undefined)

destroy()

        Description/Usage:
        Used to delete a credential from a myproxy server.
        $myproxy = Cog::Security::Myproxy->new(
                server=>$server
                );
        my @out = $myproxy->destroy(
                username=>$username,
                proxy=>$path_to_proxyfile,
                );
        Required Arguments:
                username - the username associated with the credential in
                        the myproxy server
                proxy - the full path to a live proxy file
        Returns:
                -on success: an array containing a string like:
                        "Default MyProxy credential for user cartman was 
                         succesfully removed."
                -on failure: undef (undefined)

change_pass_phrase()

        Description/Usage:
        Used to change the passphrase for a credential on a myproxy-server
        $myproxy = Cog::Security::Myproxy->new(
                server=>$server
                );
        my $out = $myproxy->change_pass_phrase(
                        username=>$username,
                        old_passphrase=>$old_pass,
                        new_passphrase=>$new_pass
                );
        Required Arguments:
                username - the username associated with the credential in
                        the myproxy server
                old_passphrase - the existing myproxy passphrase
                new_passphrase - the new passphrase you want to change to
        Returns:
                -on success: a scalar  containing the string:
                        "Passphrase changed"
                -on failure: undef (undefined)


SEE ALSO

Cog::lib::Cog::Globus::Job, Cog::lib::Cog::Globus::RSL, Cog::lib::Cog::Globus::Run, Cog::lib::Cog::Globus::URLCopy, Cog::lib::Cog::MDS::Search, Cog::lib::Cog::Security::Cacl, Cog::lib::Cog::Security::Myproxy, Cog::lib::Cog::Security::Proxy, Cog::src::Config, CogUtil::lib::CogUtil::Log, CogUtil::lib::CogUtil::UnixRun, Gridport::lib::Gridport::Authentication, Gridport::lib::Gridport::FileTransfer, Gridport::lib::Gridport::Job, Gridport::lib::Gridport::ProxyForward, Gridport::lib::Gridport::SRB, NWS::lib::NWS, SRB::lib::SRB