]> git.saurik.com Git - apple/security.git/blame - keychains/makecerts
Security-163.tar.gz
[apple/security.git] / keychains / makecerts
CommitLineData
df0e469f
A
1#!/usr/bin/perl
2#
3# Use to gather certificates into specified keychain.
4#
5$numFiles = $#ARGV;
6if($numFiles < 1) {
7 print "usage: makecerts keychainfile cert...\n";
8 die;
9}
10$dbname = $ARGV[0];
11
12my $count = 0;
13my $created;
14foreach $argnum (1 .. $numFiles) {
15 $thisCert = $ARGV[$argnum];
16 my @cmd = ("certtool", "i", $thisCert, "k=$dbname", "d");
17 do { push @cmd, "c"; $created = 1; } unless $created;
18 print "$thisCert ";
19 die if system @cmd;
20 $count++;
21}
22
23print "$count certificates placed into $dbname\n";
24exit 0;