* `nix-store --export --sign': sign the Nix archive using the RSA key

in /nix/etc/nix/signing-key.sec
This commit is contained in:
Eelco Dolstra 2007-02-21 14:31:42 +00:00
parent 6c9fdb17fb
commit 46e0919ced
8 changed files with 125 additions and 32 deletions

View file

@ -640,10 +640,14 @@ static void opRestore(Strings opFlags, Strings opArgs)
static void opExport(Strings opFlags, Strings opArgs)
{
if (!opFlags.empty()) throw UsageError("unknown flag");
bool sign = false;
for (Strings::iterator i = opFlags.begin();
i != opFlags.end(); ++i)
if (*i == "--sign") sign = true;
else throw UsageError(format("unknown flag `%1%'") % *i);
FdSink sink(STDOUT_FILENO);
store->exportPath(*opArgs.begin(), false, sink);
store->exportPath(*opArgs.begin(), sign, sink);
}