From: Jameson Rollins Date: Sun, 26 Dec 2010 00:49:59 +0000 (-0500) Subject: allow passing pkc data to msva-query-agent as argument X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a0c26721f93149ab528f992920be61f1a8d06c78;p=monkeysphere-validation-agent.git allow passing pkc data to msva-query-agent as argument This is likely only useful for 'openpgp4fpr' type, but for that it is indeed useful. This will make it considerably easier for calling programs that want to use this type (like mail clients). --- diff --git a/msva-query-agent b/msva-query-agent index 3f58c44..e4e0a68 100755 --- a/msva-query-agent +++ b/msva-query-agent @@ -24,17 +24,21 @@ use Crypt::Monkeysphere::MSVA::Client; my $context = shift; if ($context eq '--help') { printf STDERR "Usage: msva-query-agent CONTEXT PEER PKC_TYPE [PEER_TYPE] ; -}; +my $pkcdata = shift; + +if (!defined $pkcdata) { + # load raw pkc data from stdin + $pkcdata = do { + local $/; # slurp! + ; + }; +} my $client = Crypt::Monkeysphere::MSVA::Client->new( socket => $ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET}, @@ -63,6 +67,8 @@ msva-query-agent - query a Monkeysphere Validation Agent msva-query-agent CONTEXT PEER PKC_TYPE [PEER_TYPE] < /path/to/public_key_carrier +msva-query-agent CONTEXT PEER PKC_TYPE PEER_TYPE PKC_DATA + =head1 ABSTRACT msva-query-agent validates certificates for a given use by querying a @@ -94,7 +100,7 @@ service, supply the host's full DNS name (e.g. 'foo.example.net') =item PKC_TYPE The format of public key carrier data provided on standard input -(e.g. 'x509der', 'x509pem', 'opensshpubkey', 'rfc4716') +(e.g. 'x509der', 'x509pem', 'opensshpubkey', 'rfc4716', 'openpgp4fpr') =back @@ -106,6 +112,10 @@ The fourth argument is optional: The type of peer we are inquiring about (e.g. 'client', 'server') +If 5 arguments are given, the 5th argument is interpreted to be the +PKC_DATA itself. This is likely only useful for supplying an OpenPGP +fingerprint with the 'openpgp4fpr' type. + =back =head1 RETURN CODE