my $context = shift;
my $peer = shift;
my $pkctype = shift;
+my $peertype = shift;
# load raw pkc data from stdin
my $pkcdata = do {
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});
}
=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
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
=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