verify signature after build
[pharext/replicator.pharext.org] / bin / rsa-vrfy
diff --git a/bin/rsa-vrfy b/bin/rsa-vrfy
new file mode 100755 (executable)
index 0000000..1d43ec1
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env php
+<?php
+
+ini_set("error_reporting", E_ALL);
+ini_set("display_errors", true);
+
+if ($argc != 3) {
+       fprintf(STDERR, "Usage: %s <pkg name> <phar path>\n\n", basename($argv[0]));
+       exit(1);
+}
+
+list(, $pkg, $src) = $argv;
+$basename = basename($src);
+$dir = __DIR__."/../public/sigs/$pkg";
+$pub = __DIR__."/../public/replicator.pub";
+
+$cmd = sprintf("openssl dgst -verify %s -signature %s/%s.sig %s", $pub, $dir, $basename, $src);
+passthru($cmd);