2 * rootStoreTool.cpp - exercise SecTrustSettings API
9 #include <Security/Security.h>
10 #include <Security/SecTrustSettings.h>
11 #include <Security/SecTrustPriv.h>
12 #include <Security/TrustSettingsSchema.h>
13 #include <Security/SecTrustSettingsPriv.h>
14 #include <Security/cssmapplePriv.h>
15 #include <Security/SecPolicyPriv.h>
16 #include <security_cdsa_utils/cuFileIo.h>
17 #include <security_utilities/cfutilities.h>
18 #include <security_cdsa_utils/cuPrintCert.h>
19 #include <security_cdsa_utils/cuOidParser.h>
20 #include "parseTrustedRootList.h"
21 #include <Security/TrustSettingsSchema.h> /* private header */
22 #include "rootUtils.h"
23 #include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacErrors.h>
25 #include <sys/param.h>
27 static void usage(char **argv
)
29 printf("usage: %s op [options]\n", argv
[0]);
30 printf("Op values:\n");
31 printf(" a -- add cert\n");
32 printf(" p -- parse TrustSettings record\n");
33 printf(" r -- get certs from TS & display\n");
34 printf(" d -- delete entries from TS interactively\n");
35 printf(" D -- delete ALL certs from TS (requires -R argument)\n");
36 printf(" R -- remove legacy User Trust setting\n");
39 printf(" -c certFile -- specify cert\n");
40 printf(" -s -- system TrustSettings; default is user\n");
41 printf(" -d -- Admin TrustSettings; default is user\n");
42 printf(" -t settingsFile -- settings from file; default is user\n");
43 printf(" -T settingsFileOut -- settings to file\n");
44 printf(" -a appPath -- specify app constraints\n");
45 printf(" -p policy -- specify policy constraint\n");
46 printf(" policy = ssl, smime, swuSign, codeSign, IPSec, iChat\n");
47 printf(" -P appPath policy -- specify app AND policy constraint\n");
48 printf(" -e emailAddress -- specify SMIME policy plus email address\n");
49 printf(" -L hostname -- specify SSL policy plus hostname\n");
50 printf(" -r resultType -- resultType = trust, trustAsRoot, deny, unspecified\n");
51 printf(" -w allowErr -- allowed error, an integer; implies result unspecified\n");
52 printf(" -W allowErr policy -- allowed error AND policy AND implies result unspecified\n");
53 printf(" -u keyUsage -- key usage, an integer\n");
54 printf(" -k keychain -- Default is default keychain.\n");
55 printf(" -R -- Really. For Delete All op.\n");
56 printf(" -v -- verbose cert display\n");
57 printf(" -A -- add cert to keychain\n");
58 printf(" -U -- use SecTrustSetUserTrust\n");
59 printf(" -2 -- use SecTrustSetUserTrustLegacy\n");
60 printf(" -l -- loop and pause for malloc debug\n");
61 printf(" -h -- help\n");
66 * Start up a CFRunLoop. This is needed to field keychain event callbacks, used
67 * to maintain root cert cache coherency. This operation is only needed in command
68 * line tools; regular GUI apps already have a CFRunLoop.
71 /* first we need something to register so we *have* a run loop */
72 static OSStatus
kcCacheCallback (
73 SecKeychainEvent keychainEvent
,
74 SecKeychainCallbackInfo
*info
,
80 /* main thread has to wait for this to be set to know a run loop has been set up */
81 static int runLoopInitialized
= 0;
83 /* this is the thread which actually runs the CFRunLoop */
84 void *cfRunLoopThread(void *arg
)
86 OSStatus ortn
= SecKeychainAddCallback(kcCacheCallback
,
87 kSecTrustSettingsChangedEventMask
, NULL
);
89 printf("registerCacheCallbacks: SecKeychainAddCallback returned %ld", ortn
);
90 /* Not sure how this could ever happen - maybe if there is no run loop active? */
93 runLoopInitialized
= 1;
95 /* should not be reached */
96 printf("\n*** Hey! CFRunLoopRun() exited!***\n");
100 static int startCFRunLoop()
102 pthread_t runLoopThread
;
104 int result
= pthread_create(&runLoopThread
, NULL
, cfRunLoopThread
, NULL
);
106 printf("***pthread_create returned %d, aborting\n", result
);
112 static SecCertificateRef
certFromFile(
113 const char *fileName
)
115 unsigned char *cp
= NULL
;
117 if(readFile(fileName
, &cp
, &len
)) {
118 printf("***Error reading file %s\n", fileName
);
121 SecCertificateRef certRef
;
122 CSSM_DATA certData
= {len
, cp
};
123 OSStatus ortn
= SecCertificateCreateFromData(&certData
,
124 CSSM_CERT_X_509v3
, CSSM_CERT_ENCODING_DER
, &certRef
);
126 cssmPerror("SecCertificateCreateFromData", ortn
);
134 * Display usage constraints array as obtained from
135 * SecTrustSettingsCopyTrustSettings().
137 static int displayTrustSettings(
138 CFArrayRef trustSettings
,
141 /* must always be there though it may be empty */
142 if(trustSettings
== NULL
) {
143 printf("***displayTrustSettings: missing trust settings array");
146 if(CFGetTypeID(trustSettings
) != CFArrayGetTypeID()) {
147 printf("***displayTrustSettings: malformed trust settings array");
152 CFIndex numUseConstraints
= CFArrayGetCount(trustSettings
);
154 indent(); printf("Number of trust settings : %ld\n", numUseConstraints
);
156 SecPolicyRef certPolicy
;
157 SecTrustedApplicationRef certApp
;
158 CFDictionaryRef ucDict
;
159 CFStringRef policyStr
;
162 /* grind thru the trust settings dictionaries */
163 for(CFIndex ucDex
=0; ucDex
<numUseConstraints
; ucDex
++) {
164 indent(); printf("Trust Setting %ld:\n", ucDex
);
167 ucDict
= (CFDictionaryRef
)CFArrayGetValueAtIndex(trustSettings
, ucDex
);
168 if(CFGetTypeID(ucDict
) != CFDictionaryGetTypeID()) {
169 printf("***displayTrustSettings: malformed usage constraints dictionary");
174 /* policy - optional */
175 certPolicy
= (SecPolicyRef
)CFDictionaryGetValue(ucDict
, kSecTrustSettingsPolicy
);
176 if(certPolicy
!= NULL
) {
177 if(CFGetTypeID(certPolicy
) != SecPolicyGetTypeID()) {
178 printf("***displayTrustSettings: malformed certPolicy");
183 ortn
= SecPolicyGetOID(certPolicy
, &policyOid
);
185 cssmPerror("SecPolicyGetOID", ortn
);
189 indent(); printf("Policy OID : ");
190 printOid(policyOid
.Data
, policyOid
.Length
, parser
);
195 certApp
= (SecTrustedApplicationRef
)CFDictionaryGetValue(ucDict
,
196 kSecTrustSettingsApplication
);
197 if(certApp
!= NULL
) {
198 if(CFGetTypeID(certApp
) != SecTrustedApplicationGetTypeID()) {
199 printf("***displayTrustSettings: malformed certApp");
203 CFRef
<CFDataRef
> appPath
;
204 ortn
= SecTrustedApplicationCopyData(certApp
, appPath
.take());
206 cssmPerror("SecTrustedApplicationCopyData", ortn
);
210 indent(); printf("Application : %s", CFDataGetBytePtr(appPath
));
215 policyStr
= (CFStringRef
)CFDictionaryGetValue(ucDict
, kSecTrustSettingsPolicyString
);
216 if(policyStr
!= NULL
) {
217 if(CFGetTypeID(policyStr
) != CFStringGetTypeID()) {
218 printf("***displayTrustSettings: malformed policyStr");
222 indent(); printf("Policy String : ");
223 printCfStr(policyStr
); printf("\n");
227 cfNum
= (CFNumberRef
)CFDictionaryGetValue(ucDict
, kSecTrustSettingsAllowedError
);
229 if(CFGetTypeID(cfNum
) != CFNumberGetTypeID()) {
230 printf("***displayTrustSettings: malformed allowedError");
234 indent(); printf("Allowed Error : ");
235 printCssmErr(cfNum
); printf("\n");
239 cfNum
= (CFNumberRef
)CFDictionaryGetValue(ucDict
, kSecTrustSettingsResult
);
241 if(CFGetTypeID(cfNum
) != CFNumberGetTypeID()) {
242 printf("***displayTrustSettings: malformed Result");
246 indent(); printf("Result Type : ");
247 printResult(cfNum
); printf("\n");
251 cfNum
= (CFNumberRef
)CFDictionaryGetValue(ucDict
, kSecTrustSettingsKeyUsage
);
253 if(CFGetTypeID(cfNum
) != CFNumberGetTypeID()) {
254 printf("***displayTrustSettings: malformed keyUsage");
258 indent(); printf("Key Usage : ");
259 printKeyUsage(cfNum
); printf("\n");
269 /* convert an OID to a SecPolicyRef */
270 static SecPolicyRef
oidToPolicy(
273 SecPolicyRef policyRef
= NULL
;
275 OSStatus ortn
= SecPolicyCopy(CSSM_CERT_X_509v3
, &oid
, &policyRef
);
277 cssmPerror("SecPolicyCopy", ortn
);
283 /* Convert cmdline policy string to SecPolicyRef */
284 static SecPolicyRef
policyStringToPolicy(
290 const CSSM_OID
*oid
= NULL
;
291 if(!strcmp(policy
, "ssl")) {
292 oid
= &CSSMOID_APPLE_TP_SSL
;
294 else if(!strcmp(policy
, "smime")) {
295 oid
= &CSSMOID_APPLE_TP_SMIME
;
297 else if(!strcmp(policy
, "codeSign")) {
298 oid
= &CSSMOID_APPLE_TP_CODE_SIGNING
;
300 else if(!strcmp(policy
, "swuSign")) {
301 oid
= &CSSMOID_APPLE_TP_SW_UPDATE_SIGNING
;
303 else if(!strcmp(policy
, "IPSec")) {
304 oid
= &CSSMOID_APPLE_TP_IP_SEC
;
306 else if(!strcmp(policy
, "iChat")) {
307 oid
= &CSSMOID_APPLE_TP_ICHAT
;
310 printf("***Unknown policy string (%s)\n", policy
);
314 /* OID to SecPolicyRef */
315 return oidToPolicy(*oid
);
318 static int appendConstraintToArray(
319 const char *appPath
, /* optional, "-" means ensure apArray is nonempty */
320 const char *policy
, /* optional (ssl/smime), "-" as above */
321 const char *policyStr
, /* optional policy string */
322 const SInt32
*allowErr
, /* optional allowed error */
323 const char *resultType
, /* optional allow/confirm/deny */
324 SecTrustSettingsKeyUsage keyUse
, /* optional key use */
325 CFMutableArrayRef
&array
) /* result RETURNED here, created if necessary */
328 array
= CFArrayCreateMutable(NULL
, 0, &kCFTypeArrayCallBacks
);
331 CFMutableDictionaryRef outDict
= CFDictionaryCreateMutable(NULL
,
333 &kCFTypeDictionaryKeyCallBacks
,
334 &kCFTypeDictionaryValueCallBacks
);
336 if((policy
!= NULL
) && (strcmp(policy
, "-"))) {
338 /* policy string to SecPolicyRef */
339 SecPolicyRef policyRef
= policyStringToPolicy(policy
);
340 if(policyRef
== NULL
) {
343 CFDictionaryAddValue(outDict
, kSecTrustSettingsPolicy
, policyRef
);
344 CFRelease(policyRef
);
347 /* app string to SecTrustedApplicationRef */
348 if((appPath
!= NULL
) && (strcmp(appPath
, "-"))) {
349 SecTrustedApplicationRef appRef
;
350 OSStatus ortn
= SecTrustedApplicationCreateFromPath(appPath
, &appRef
);
352 cssmPerror("SecTrustedApplicationCreateFromPath", ortn
);
355 CFDictionaryAddValue(outDict
, kSecTrustSettingsApplication
, appRef
);
359 if(policyStr
!= NULL
) {
360 CFStringRef pstr
= CFStringCreateWithCString(NULL
, policyStr
, kCFStringEncodingASCII
);
361 CFDictionaryAddValue(outDict
, kSecTrustSettingsPolicyString
, pstr
);
365 if(allowErr
!= NULL
) {
366 CFNumberRef cfNum
= CFNumberCreate(NULL
, kCFNumberSInt32Type
, allowErr
);
367 CFDictionaryAddValue(outDict
, kSecTrustSettingsAllowedError
, cfNum
);
372 SInt32 ku
= (SInt32
)ku
;
373 CFNumberRef cfNum
= CFNumberCreate(NULL
, kCFNumberSInt32Type
, &ku
);
374 CFDictionaryAddValue(outDict
, kSecTrustSettingsKeyUsage
, cfNum
);
378 if(resultType
!= NULL
) {
381 if(!strcmp(resultType
, "trust")) {
382 n
= kSecTrustSettingsResultTrustRoot
;
384 else if(!strcmp(resultType
, "trustAsRoot")) {
385 n
= kSecTrustSettingsResultTrustAsRoot
;
387 else if(!strcmp(resultType
, "deny")) {
388 n
= kSecTrustSettingsResultDeny
;
390 else if(!strcmp(resultType
, "unspecified")) {
391 n
= kSecTrustSettingsResultUnspecified
;
394 printf("***unknown resultType spec (%s)\n", resultType
);
397 CFNumberRef cfNum
= CFNumberCreate(NULL
, kCFNumberSInt32Type
, &n
);
398 CFDictionaryAddValue(outDict
, kSecTrustSettingsResult
, cfNum
);
402 /* append dictionary to output */
403 CFArrayAppendValue(array
, outDict
);
404 /* array owns the dictionary now */
409 /* read a file --> CFDataRef */
410 CFDataRef
readFileCFData(
411 const char *fileName
)
414 unsigned char *fileData
= NULL
;
415 unsigned fileDataLen
= 0;
417 rtn
= readFile(fileName
, &fileData
, &fileDataLen
);
419 printf("Error (%d) reading %s.\n", rtn
, fileName
);
422 CFDataRef cfd
= CFDataCreate(NULL
, (const UInt8
*)fileData
, fileDataLen
);
427 static int fetchParseTrustRecord(
428 SecTrustSettingsDomain domain
,
429 char *settingsFile
) /* optional, ignore domain if present */
431 CFDataRef trustSettings
= NULL
;
434 trustSettings
= readFileCFData(settingsFile
);
435 if(trustSettings
== NULL
) {
440 OSStatus ortn
= SecTrustSettingsCreateExternalRepresentation(domain
, &trustSettings
);
442 cssmPerror("SecTrustSettingsCreateExternalRepresentation", ortn
);
446 int rtn
= parseTrustedRootList(trustSettings
);
447 CFRelease(trustSettings
);
451 static int copyCertsAndDisplay(
453 SecTrustSettingsDomain domain
)
457 auto_ptr
<OidParser
> parser(NULL
);
460 parser
.reset(new OidParser
);
463 CFArrayRef certArray
= NULL
;
464 ortn
= SecTrustSettingsCopyCertificates(domain
, &certArray
);
466 cssmPerror("SecTrustSettingsCopyCertificates", ortn
);
470 CFIndex numCerts
= CFArrayGetCount(certArray
);
472 printf("Num certs = %ld\n", numCerts
);
474 for(CFIndex dex
=0; dex
<numCerts
; dex
++) {
475 SecCertificateRef certRef
= (SecCertificateRef
)CFArrayGetValueAtIndex(certArray
, dex
);
476 if(CFGetTypeID(certRef
) != SecCertificateGetTypeID()) {
477 printf("***Bad CFGetTypeID for cert\n");
481 printf("Cert %ld: ", dex
);
482 printCertLabel(certRef
);
485 CFRef
<CFArrayRef
> appPolicies
;
486 ortn
= SecTrustSettingsCopyTrustSettings(certRef
, domain
, appPolicies
.take());
488 cssmPerror("SecRootCertificateCopyAppPolicyConstraints", ortn
);
492 if(displayTrustSettings(appPolicies
, *parser
.get())) {
497 CFRelease(certArray
);
501 static int deleteCerts(
502 SecTrustSettingsDomain domain
,
507 CFArrayRef certArray
= NULL
;
508 ortn
= SecTrustSettingsCopyCertificates(domain
, &certArray
);
510 cssmPerror("SecTrustSettingsCopyCertificates", ortn
);
514 CFIndex numCerts
= CFArrayGetCount(certArray
);
515 unsigned numDeleted
= 0;
517 for(CFIndex dex
=0; dex
<numCerts
; dex
++) {
518 SecCertificateRef certRef
= (SecCertificateRef
)CFArrayGetValueAtIndex(certArray
, dex
);
519 if(CFGetTypeID(certRef
) != SecCertificateGetTypeID()) {
520 printf("***Bad CFGetTypeID for cert\n");
523 bool doDelete
= false;
526 printf("DELETING: ");
527 printCertLabel(certRef
);
533 printf("Cert %ld: ", dex
);
534 printCertLabel(certRef
);
537 printf("Delete (y/anything)? ");
538 char resp
= getchar();
544 ortn
= SecTrustSettingsRemoveTrustSettings(certRef
, domain
);
546 cssmPerror("SecTrustSettingsRemoveTrustSettings", ortn
);
548 printf("Continue deleting (y/anything)? ");
549 char resp
= getchar();
560 CFRelease(certArray
);
561 printf("...%u certs deleted\n", numDeleted
);
565 /* add a cert to trust list */
567 SecCertificateRef certRef
,
568 SecTrustSettingsDomain domain
,
569 bool addToKc
, // import cert to keychain
570 const char *kcName
, // only for addToKC option
571 CFArrayRef trustSettings
,
572 CFDataRef settingsIn
, // optional, requires settingsFileOut
573 CFDataRef
*settingsOut
)
578 if(settingsIn
&& !settingsOut
) {
579 printf("Modifying trust settings as file requires output file\n");
583 case kSecTrustSettingsDomainSystem
:
584 printf("***Can't modify system trust settings.\n");
586 case kSecTrustSettingsDomainAdmin
:
587 kcName
= "/Library/Keychains/System.keychain";
588 domainName
= "Admin";
595 SecKeychainRef kcRef
= NULL
;
597 ortn
= SecKeychainOpen(kcName
, &kcRef
);
599 cssmPerror("SecKeychainOpen", ortn
);
603 ortn
= SecCertificateAddToKeychain(certRef
, kcRef
);
605 cssmPerror("SecCertificateAddToKeychain", ortn
);
608 printf("...cert added to keychain %s\n", (kcName
? kcName
: "<default>"));
611 ortn
= SecTrustSettingsSetTrustSettingsExternal(settingsIn
,
612 certRef
, trustSettings
, settingsOut
);
614 cssmPerror("SecTrustSettingsSetTrustSettingsExternal", ortn
);
619 ortn
= SecTrustSettingsSetTrustSettings(certRef
, domain
, trustSettings
);
621 cssmPerror("SecTrustSettingsSetTrustSettings", ortn
);
624 printf("...cert added to %s TrustList.\n", domainName
);
629 static int addCertLegacy(
630 SecCertificateRef certRef
,
632 const char *resultStr
,
635 /* OID string to an OID pointer */
637 printf("***You must specify a policy to set legacy User Trust\n");
640 SecPolicyRef policyRef
= policyStringToPolicy(policy
);
641 if(policyRef
== NULL
) {
645 /* result string to legacy SecTrustUserSetting */
646 SecTrustUserSetting setting
= kSecTrustResultInvalid
;
647 if(resultStr
== NULL
) {
648 setting
= kSecTrustResultProceed
;
650 else if(!strcmp(resultStr
, "trust")) {
651 setting
= kSecTrustResultProceed
;
653 else if(!strcmp(resultStr
, "trustAsRoot")) {
654 setting
= kSecTrustResultProceed
;
656 else if(!strcmp(resultStr
, "deny")) {
657 setting
= kSecTrustResultDeny
;
659 else if (!strcmp(resultStr
, "unspecified")) {
660 setting
= kSecTrustResultUnspecified
;
663 printf("***Can't map %s to a SecTrustUserSetting\n", resultStr
);
668 ortn
= SecTrustSetUserTrustLegacy(certRef
, policyRef
, setting
);
670 cssmPerror("SecTrustSetUserTrustLegacy", ortn
);
673 if(setting
== kSecTrustResultUnspecified
) {
674 printf("...User Trust removed via SecTrustSetUserTrustLegacy().\n");
677 printf("...User Trust set via SecTrustSetUserTrustLegacy().\n");
683 printf("...Legacy implementation needs Makefile work to avoid deprecation error\n");
686 ortn
= SecTrustSetUserTrust(certRef
, policyRef
, setting
);
688 cssmPerror("SecTrustSetUserTrust", ortn
);
691 printf("...trust setting set via SecTrustSetUserTrust().\n");
695 if(policyRef
!= NULL
) {
696 CFRelease(policyRef
);
701 int main(int argc
, char **argv
)
704 CFMutableArrayRef appPolicies
= NULL
;
705 CFDataRef settingsIn
= NULL
;
706 CFDataRef settingsOut
= NULL
;
708 /* user-spec'd variables */
709 bool loopPause
= false;
711 bool verbose
= false;
713 SecTrustSettingsDomain domain
= kSecTrustSettingsDomainUser
;
714 SecCertificateRef certRef
= NULL
;
715 bool addToKeychain
= false;
716 char *settingsFileIn
= NULL
;
717 char *settingsFileOut
= NULL
;
718 bool userTrustLegacy
= false;
719 char *policyStr
= NULL
;
720 char *resultStr
= NULL
;
721 bool userTrust
= false;
726 while ((arg
= getopt(argc
, argv
, "c:sdt:T:a:p:P:e:L:r:w:W:k:u:RvAU2lh")) != -1) {
730 printf("***Only one cert at a time, please.\n");
733 certRef
= certFromFile(optarg
);
734 if(certRef
== NULL
) {
739 domain
= kSecTrustSettingsDomainSystem
;
742 domain
= kSecTrustSettingsDomainAdmin
;
745 settingsFileIn
= optarg
;
748 settingsFileOut
= optarg
;
751 if(appendConstraintToArray(optarg
, NULL
, NULL
, NULL
, NULL
, 0, appPolicies
)) {
756 if(appendConstraintToArray(NULL
, optarg
, NULL
, NULL
, NULL
, 0, appPolicies
)) {
762 /* this takes an additional argument */
763 if(optind
> (argc
- 1)) {
766 if(appendConstraintToArray(optarg
, argv
[optind
], NULL
, NULL
, NULL
,
773 if(appendConstraintToArray(NULL
, "smime", optarg
, NULL
, NULL
,
780 if(appendConstraintToArray(NULL
, "ssl", optarg
, NULL
, NULL
, 0, appPolicies
)) {
786 if(appendConstraintToArray(NULL
, NULL
, NULL
, NULL
, optarg
, 0, appPolicies
)) {
793 SInt32 l
= atol(optarg
);
794 if(appendConstraintToArray(NULL
, NULL
, NULL
, &l
, "unspecified", 0, appPolicies
)) {
801 /* this takes an additional argument */
802 if(optind
> (argc
- 1)) {
805 SInt32 l
= atol(optarg
);
806 if(appendConstraintToArray(NULL
, argv
[optind
], NULL
, &l
, "unspecified", 0,
815 SInt32 l
= atol(optarg
);
816 SecTrustSettingsKeyUsage ku
= (SecTrustSettingsKeyUsage
)l
;
817 if(appendConstraintToArray(NULL
, NULL
, NULL
, NULL
, NULL
, ku
, appPolicies
)) {
832 addToKeychain
= true;
838 userTrustLegacy
= true;
851 if(startCFRunLoop()) {
852 /* enable reception of KC event messages */
856 /* give that thread a chance right now */
857 while(!runLoopInitialized
) {
865 if(certRef
== NULL
) {
866 printf("You must supply a cert.\n");
870 if(!settingsFileOut
) {
871 printf("Modifying trust settings as file requires output file\n");
874 settingsIn
= readFileCFData(settingsFileIn
);
879 if(userTrustLegacy
|| userTrust
) {
880 ortn
= addCertLegacy(certRef
, policyStr
, resultStr
, userTrustLegacy
);
883 ortn
= addCert(certRef
, domain
, addToKeychain
, kcName
, appPolicies
,
884 settingsIn
, &settingsOut
);
885 if((ortn
== noErr
) && (settingsOut
!= NULL
)) {
886 unsigned len
= CFDataGetLength(settingsOut
);
887 if(writeFile(settingsFileOut
, CFDataGetBytePtr(settingsOut
), len
)) {
888 printf("***Error writing settings to %s\n", settingsFileOut
);
891 printf("...wrote %u bytes to %s\n", len
, settingsFileOut
);
896 CFRelease(settingsIn
);
899 CFRelease(settingsOut
);
903 ortn
= fetchParseTrustRecord(domain
, settingsFileIn
);
906 ortn
= copyCertsAndDisplay(verbose
, domain
);
909 ortn
= deleteCerts(domain
, false);
913 printf("I do not believe you. Specify -D option to delete all roots.\n");
916 ortn
= deleteCerts(domain
, true);
919 ortn
= addCertLegacy(certRef
, policyStr
, "unspecified", true);
926 printf("Pausing for MallocDebug. Hit CR to continue: ");