do not bother tracking generated manpages
[monkeysphere-validation-agent.git] / msva-query-agent
index 1eaff50adcf5365b040423baaf2f1d3eb00ea17d..7bd21ea01bfa190f8d14c46aabc63793fd99826a 100755 (executable)
@@ -24,6 +24,7 @@ use Crypt::Monkeysphere::MSVA::Client;
 my $context = shift;
 my $peer = shift;
 my $pkctype = shift;
+my $peertype = shift;
 
 # load raw pkc data from stdin
 my $pkcdata = do {
@@ -36,13 +37,13 @@ my $client = Crypt::Monkeysphere::MSVA::Client->new(
                                                     log_level => $ENV{MSVA_LOG_LEVEL},
                                                    );
 
-my ($status,$ret) = $client->query_agent($context,$peer,$pkctype,$pkcdata);
+my ($status,$ret) = $client->query_agent($context,$peer,$peertype,$pkctype,$pkcdata);
 
 $client->log('info', "status: %s\n", $status);
 if (defined $ret) {
   $client->log('info', "valid: %s\n", $ret->{valid});
-  $client->log('fatal', "message: %s\n", $ret->{message});
   $client->log('info', "server: %s\n", $ret->{server});
+  printf("%s\n", $ret->{message});
   exit 0
     if ($ret->{valid});
 }
@@ -56,7 +57,7 @@ msva-query-agent - query a Monkeysphere Validation Agent
 
 =head1 SYNOPSIS
 
-msva-query-agent CONTEXT PEER PKC_TYPE < /path/to/public_key_carrier
+msva-query-agent CONTEXT PEER PKC_TYPE [PEERTYPE] < /path/to/public_key_carrier
 
 =head1 ABSTRACT
 
@@ -69,10 +70,10 @@ msva-query-agent reads a certificate from standard input, and posts it
 to the running Monkeysphere Validation Agent.  The return code
 indicates the validity (as determined by the agent) of the certificate
 for the specified purpose.  The agent's return message (if any) is
-emitted on stderr.
+emitted on stdout.
 
-Three command-line arguments are all required, supplied in order, as
-follows:
+The first three command-line arguments are all required, supplied in
+order, as follows:
 
 =over 4
 
@@ -93,6 +94,16 @@ The format of public key carrier data provided on standard input
 
 =back
 
+The fourth argument is optional:
+
+=over 4
+
+=item PEERTYPE
+
+The type of peer we are inquiring about (e.g. 'client', 'server')
+
+=back
+
 =head1 RETURN CODE
 
 If the certificate is valid for the requested peer in the given