]> git.saurik.com Git - apple/security.git/blob - keychains/makecerts
157320d6269e45f6bf83da2210a31b7ff07a24f4
[apple/security.git] / keychains / makecerts
1 #!/usr/bin/perl
2 #
3 # Use to gather certificates into specified keychain.
4 #
5 $numFiles = $#ARGV;
6 if($numFiles < 1) {
7 print "usage: makecerts keychainfile cert...\n";
8 die;
9 }
10 $dbname = $ARGV[0];
11
12 my $count = 0;
13 my $created;
14 foreach $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
23 print "$count certificates placed into $dbname\n";
24 exit 0;