apple-codesign 0.29.0

Pure Rust interface to code signing on Apple platforms
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
A child bundle can exist outside a directory marked as "nested" in the
CodeResources rules set. In this case, the child bundle is treated like
a regular directory and not signed as a bundle.

But when signing in non-shallow mode, we need to avoid signing Mach-O
binaries in the child bundle because they would have already been signed
as part of signing the child bundle.

This test is inspired from #149.

```
$ rcodesign debug-create-macho MyApp.app/Contents/MacOS/MyApp
assuming default minimum version 11.0.0
writing Mach-O to MyApp.app/Contents/MacOS/MyApp

$ rcodesign debug-create-info-plist --bundle-name MyApp MyApp.app/Contents/Info.plist
writing MyApp.app/Contents/Info.plist

$ rcodesign debug-create-macho MyApp.app/Contents/lib/foo/exe
assuming default minimum version 11.0.0
writing Mach-O to MyApp.app/Contents/lib/foo/exe

$ rcodesign debug-create-macho MyApp.app/Contents/lib/foo/child.app/Contents/MacOS/child
assuming default minimum version 11.0.0
writing Mach-O to MyApp.app/Contents/lib/foo/child.app/Contents/MacOS/child

$ rcodesign debug-create-info-plist --bundle-name child MyApp.app/Contents/lib/foo/child.app/Contents/Info.plist
writing MyApp.app/Contents/lib/foo/child.app/Contents/Info.plist

$ rcodesign debug-create-macho MyApp.app/Contents/lib/foo/child.app/Contents/MacOS/extra-exe
assuming default minimum version 11.0.0
writing Mach-O to MyApp.app/Contents/lib/foo/child.app/Contents/MacOS/extra-exe

$ rcodesign sign MyApp.app MyApp.app.signed
signing MyApp.app to MyApp.app.signed
signing bundle at MyApp.app
signing 1 nested bundles in the following order:
Contents/lib/foo/child.app
entering nested bundle Contents/lib/foo/child.app
signing bundle at MyApp.app/Contents/lib/foo/child.app into MyApp.app.signed/Contents/lib/foo/child.app
signing Mach-O file Contents/MacOS/extra-exe
signing main executable Contents/MacOS/child
leaving nested bundle Contents/lib/foo/child.app
signing bundle at MyApp.app into MyApp.app.signed
signing Mach-O file Contents/lib/foo/exe
signing main executable Contents/MacOS/MyApp

$ rcodesign debug-file-tree MyApp.app.signed
d                      MyApp.app.signed/
d                      MyApp.app.signed/Contents
f 0a5902dc8e47f490d038 MyApp.app.signed/Contents/Info.plist
d                      MyApp.app.signed/Contents/MacOS
f c106af767c277207a6ad MyApp.app.signed/Contents/MacOS/MyApp
d                      MyApp.app.signed/Contents/_CodeSignature
f ade78fe52d723803b6cf MyApp.app.signed/Contents/_CodeSignature/CodeResources
d                      MyApp.app.signed/Contents/lib
d                      MyApp.app.signed/Contents/lib/foo
d                      MyApp.app.signed/Contents/lib/foo/child.app
d                      MyApp.app.signed/Contents/lib/foo/child.app/Contents
f 4c5130ae58d7184aa747 MyApp.app.signed/Contents/lib/foo/child.app/Contents/Info.plist
d                      MyApp.app.signed/Contents/lib/foo/child.app/Contents/MacOS
f 8d2bb481b183bd66403b MyApp.app.signed/Contents/lib/foo/child.app/Contents/MacOS/child
f d4637e70eed799f72544 MyApp.app.signed/Contents/lib/foo/child.app/Contents/MacOS/extra-exe
d                      MyApp.app.signed/Contents/lib/foo/child.app/Contents/_CodeSignature
f 164aae2ea1c61b76cd81 MyApp.app.signed/Contents/lib/foo/child.app/Contents/_CodeSignature/CodeResources
f 2adcd25a21eb14fc3f7b MyApp.app.signed/Contents/lib/foo/exe

$ rcodesign print-signature-info MyApp.app.signed
- path: Contents/Info.plist
  file_size: 576
  file_sha256: 0a5902dc8e47f490d03889d3593d17bddbf79e6c1f79494e20dd28f9459effa5
  entity: other
- path: Contents/MacOS/MyApp
  file_size: 22544
  file_sha256: c106af767c277207a6adf0bac84ba1caa5b510fd11db5f3ec7dcc0830bed66b1
  entity:
    mach_o:
      macho_linkedit_start_offset: 16384 / 0x4000
      macho_signature_start_offset: 16400 / 0x4010
      macho_signature_end_offset: 16821 / 0x41b5
      macho_linkedit_end_offset: 22544 / 0x5810
      macho_end_offset: 22544 / 0x5810
      linkedit_signature_start_offset: 16 / 0x10
      linkedit_signature_end_offset: 437 / 0x1b5
      linkedit_bytes_after_signature: 5723 / 0x165b
      signature:
        superblob_length: 421 / 0x1a5
        blob_count: 3
        blobs:
        - slot: CodeDirectory (0)
          magic: fade0c02
          length: 365
          sha1: 807803de9fec161102ccaa46c27047bfff1d6af1
          sha256: 88b6f97438eb59baad281e3cb35e7621bead272852380b058fc73ea90c78353f
        - slot: RequirementSet (2)
          magic: fade0c01
          length: 12
          sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973
          sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986
        - slot: CMS Signature (65536)
          magic: fade0b01
          length: 8
          sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b
          sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0
        code_directory:
          version: '0x20400'
          flags: CodeSignatureFlags(ADHOC)
          identifier: com.example.mybundle
          digest_type: sha256
          platform: 0
          signed_entity_size: 16400
          executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY)
          code_digests_count: 5
          slot_digests:
          - 'Info (1): 0a5902dc8e47f490d03889d3593d17bddbf79e6c1f79494e20dd28f9459effa5'
          - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986'
          - 'Resources (3): ade78fe52d723803b6cf8398715169db305938bbaaf08b9d185a64211bd27e6d'
        cms: null
- path: Contents/_CodeSignature/CodeResources
  file_size: 2824
  file_sha256: ade78fe52d723803b6cf8398715169db305938bbaaf08b9d185a64211bd27e6d
  entity:
    bundle_code_signature_file: !ResourcesXml
    - <?xml version="1.0" encoding="UTF-8"?>
    - <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    - <plist version="1.0">
    - <dict>
    - '  <key>files</key>'
    - '  <dict/>'
    - '  <key>files2</key>'
    - '  <dict>'
    - '    <key>lib/foo/child.app/Contents/Info.plist</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      TFEwrljXGEqnR7LZD/HiHXVCvWvV3ZQjm+Lphz/9pZ4='
    - '      </data>'
    - '    </dict>'
    - '    <key>lib/foo/child.app/Contents/MacOS/child</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      jSu0gbGDvWZAO21MEqe6C7r9WFbXmTMk+kW/f203LT8='
    - '      </data>'
    - '    </dict>'
    - '    <key>lib/foo/child.app/Contents/MacOS/extra-exe</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      1GN+cO7XmfclRNEqlCdbwEu89NOQkcykJmFIUAsxj6g='
    - '      </data>'
    - '    </dict>'
    - '    <key>lib/foo/exe</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      KtzSWiHrFPw/e1yk9UZbUV8hk53ZhD3lv32eP3rPqds='
    - '      </data>'
    - '    </dict>'
    - '  </dict>'
    - '  <key>rules</key>'
    - '  <dict>'
    - '    <key>^Resources/</key>'
    - '    <true/>'
    - '    <key>^Resources/.*/.lproj/</key>'
    - '    <dict>'
    - '      <key>optional</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1000</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/locversion.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1100</real>'
    - '    </dict>'
    - '    <key>^Resources/Base/.lproj/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>1010</real>'
    - '    </dict>'
    - '    <key>^version.plist$</key>'
    - '    <true/>'
    - '  </dict>'
    - '  <key>rules2</key>'
    - '  <dict>'
    - '    <key>.*/.dSYM($|/)</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>11</real>'
    - '    </dict>'
    - '    <key>^(.*/)?/.DS_Store$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>2000</real>'
    - '    </dict>'
    - '    <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>'
    - '    <dict>'
    - '      <key>nested</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>10</real>'
    - '    </dict>'
    - '    <key>^.*</key>'
    - '    <true/>'
    - '    <key>^Info/.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^PkgInfo$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^Resources/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/</key>'
    - '    <dict>'
    - '      <key>optional</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1000</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/locversion.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1100</real>'
    - '    </dict>'
    - '    <key>^Resources/Base/.lproj/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>1010</real>'
    - '    </dict>'
    - '    <key>^[^/]+$</key>'
    - '    <dict>'
    - '      <key>nested</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>10</real>'
    - '    </dict>'
    - '    <key>^embedded/.provisionprofile$</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^version/.plist$</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '  </dict>'
    - </dict>
    - </plist>
    - ''
- path: Contents/lib/foo/child.app/Contents/Info.plist
  file_size: 576
  file_sha256: 4c5130ae58d7184aa747b2d90ff1e21d7542bd6bd5dd94239be2e9873ffda59e
  entity: other
- path: Contents/lib/foo/child.app/Contents/MacOS/child
  file_size: 22544
  file_sha256: 8d2bb481b183bd66403b6d4c12a7ba0bbafd5856d7993324fa45bf7f6d372d3f
  entity:
    mach_o:
      macho_linkedit_start_offset: 16384 / 0x4000
      macho_signature_start_offset: 16400 / 0x4010
      macho_signature_end_offset: 16821 / 0x41b5
      macho_linkedit_end_offset: 22544 / 0x5810
      macho_end_offset: 22544 / 0x5810
      linkedit_signature_start_offset: 16 / 0x10
      linkedit_signature_end_offset: 437 / 0x1b5
      linkedit_bytes_after_signature: 5723 / 0x165b
      signature:
        superblob_length: 421 / 0x1a5
        blob_count: 3
        blobs:
        - slot: CodeDirectory (0)
          magic: fade0c02
          length: 365
          sha1: da2d1d20b15073dc7c0ea2b9bdf0265b1c60b9d7
          sha256: 5df5b910c1b35258c22d107a13dccdfad7f747d4c1d6726d72b54c264de1bd40
        - slot: RequirementSet (2)
          magic: fade0c01
          length: 12
          sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973
          sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986
        - slot: CMS Signature (65536)
          magic: fade0b01
          length: 8
          sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b
          sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0
        code_directory:
          version: '0x20400'
          flags: CodeSignatureFlags(ADHOC)
          identifier: com.example.mybundle
          digest_type: sha256
          platform: 0
          signed_entity_size: 16400
          executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY)
          code_digests_count: 5
          slot_digests:
          - 'Info (1): 4c5130ae58d7184aa747b2d90ff1e21d7542bd6bd5dd94239be2e9873ffda59e'
          - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986'
          - 'Resources (3): 164aae2ea1c61b76cd8120aceaa7ab635c0a01514682e049bdde384d788fb677'
        cms: null
- path: Contents/lib/foo/child.app/Contents/MacOS/extra-exe
  file_size: 22544
  file_sha256: d4637e70eed799f72544d12a94275bc04bbcf4d39091cca4266148500b318fa8
  entity:
    mach_o:
      macho_linkedit_start_offset: 16384 / 0x4000
      macho_signature_start_offset: 16400 / 0x4010
      macho_signature_end_offset: 16778 / 0x418a
      macho_linkedit_end_offset: 22544 / 0x5810
      macho_end_offset: 22544 / 0x5810
      linkedit_signature_start_offset: 16 / 0x10
      linkedit_signature_end_offset: 394 / 0x18a
      linkedit_bytes_after_signature: 5766 / 0x1686
      signature:
        superblob_length: 378 / 0x17a
        blob_count: 3
        blobs:
        - slot: CodeDirectory (0)
          magic: fade0c02
          length: 322
          sha1: 99068332ebb6b9cc3d9c9534835a7f6c12c434ee
          sha256: feb5492886d3537f86aead02ebd705a5a4eec2e656c28357a20fd814a34d8c06
        - slot: RequirementSet (2)
          magic: fade0c01
          length: 12
          sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973
          sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986
        - slot: CMS Signature (65536)
          magic: fade0b01
          length: 8
          sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b
          sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0
        code_directory:
          version: '0x20400'
          flags: CodeSignatureFlags(ADHOC)
          identifier: extra-exe
          digest_type: sha256
          platform: 0
          signed_entity_size: 16400
          executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY)
          code_digests_count: 5
          slot_digests:
          - 'Info (1): 0000000000000000000000000000000000000000000000000000000000000000'
          - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986'
        cms: null
- path: Contents/lib/foo/child.app/Contents/_CodeSignature/CodeResources
  file_size: 2427
  file_sha256: 164aae2ea1c61b76cd8120aceaa7ab635c0a01514682e049bdde384d788fb677
  entity:
    bundle_code_signature_file: !ResourcesXml
    - <?xml version="1.0" encoding="UTF-8"?>
    - <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    - <plist version="1.0">
    - <dict>
    - '  <key>files</key>'
    - '  <dict/>'
    - '  <key>files2</key>'
    - '  <dict>'
    - '    <key>MacOS/extra-exe</key>'
    - '    <dict>'
    - '      <key>cdhash</key>'
    - '      <data>'
    - '      /rVJKIbTU3+Grq0C69cFpaTuwuY='
    - '      </data>'
    - '      <key>requirement</key>'
    - '      <string>cdhash H"feb5492886d3537f86aead02ebd705a5a4eec2e6"</string>'
    - '    </dict>'
    - '  </dict>'
    - '  <key>rules</key>'
    - '  <dict>'
    - '    <key>^Resources/</key>'
    - '    <true/>'
    - '    <key>^Resources/.*/.lproj/</key>'
    - '    <dict>'
    - '      <key>optional</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1000</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/locversion.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1100</real>'
    - '    </dict>'
    - '    <key>^Resources/Base/.lproj/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>1010</real>'
    - '    </dict>'
    - '    <key>^version.plist$</key>'
    - '    <true/>'
    - '  </dict>'
    - '  <key>rules2</key>'
    - '  <dict>'
    - '    <key>.*/.dSYM($|/)</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>11</real>'
    - '    </dict>'
    - '    <key>^(.*/)?/.DS_Store$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>2000</real>'
    - '    </dict>'
    - '    <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>'
    - '    <dict>'
    - '      <key>nested</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>10</real>'
    - '    </dict>'
    - '    <key>^.*</key>'
    - '    <true/>'
    - '    <key>^Info/.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^PkgInfo$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^Resources/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/</key>'
    - '    <dict>'
    - '      <key>optional</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1000</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/locversion.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1100</real>'
    - '    </dict>'
    - '    <key>^Resources/Base/.lproj/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>1010</real>'
    - '    </dict>'
    - '    <key>^[^/]+$</key>'
    - '    <dict>'
    - '      <key>nested</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>10</real>'
    - '    </dict>'
    - '    <key>^embedded/.provisionprofile$</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^version/.plist$</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '  </dict>'
    - </dict>
    - </plist>
    - ''
- path: Contents/lib/foo/exe
  file_size: 22544
  file_sha256: 2adcd25a21eb14fc3f7b5ca4f5465b515f21939dd9843de5bf7d9e3f7acfa9db
  entity:
    mach_o:
      macho_linkedit_start_offset: 16384 / 0x4000
      macho_signature_start_offset: 16400 / 0x4010
      macho_signature_end_offset: 16772 / 0x4184
      macho_linkedit_end_offset: 22544 / 0x5810
      macho_end_offset: 22544 / 0x5810
      linkedit_signature_start_offset: 16 / 0x10
      linkedit_signature_end_offset: 388 / 0x184
      linkedit_bytes_after_signature: 5772 / 0x168c
      signature:
        superblob_length: 372 / 0x174
        blob_count: 3
        blobs:
        - slot: CodeDirectory (0)
          magic: fade0c02
          length: 316
          sha1: 4ca6f9ee2bfe2bfac44ab4e9e9c1ef9b6e4fc0de
          sha256: 23fc7207e52f23c0f6d2317dbb92cf9eff2aca8fe61ac241900d48be8f46cf5c
        - slot: RequirementSet (2)
          magic: fade0c01
          length: 12
          sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973
          sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986
        - slot: CMS Signature (65536)
          magic: fade0b01
          length: 8
          sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b
          sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0
        code_directory:
          version: '0x20400'
          flags: CodeSignatureFlags(ADHOC)
          identifier: exe
          digest_type: sha256
          platform: 0
          signed_entity_size: 16400
          executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY)
          code_digests_count: 5
          slot_digests:
          - 'Info (1): 0000000000000000000000000000000000000000000000000000000000000000'
          - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986'
        cms: null

$ rcodesign sign --shallow MyApp.app MyApp.app.signed-shallow
signing MyApp.app to MyApp.app.signed-shallow
signing bundle at MyApp.app
1 nested bundles will be copied instead of signed because shallow signing enabled:
Contents/lib/foo/child.app
entering nested bundle Contents/lib/foo/child.app
shallow signing enabled; bundle will be copied instead of signed
leaving nested bundle Contents/lib/foo/child.app
signing bundle at MyApp.app into MyApp.app.signed-shallow
signing main executable Contents/MacOS/MyApp

$ rcodesign debug-file-tree MyApp.app.signed-shallow
d                      MyApp.app.signed-shallow/
d                      MyApp.app.signed-shallow/Contents
f 0a5902dc8e47f490d038 MyApp.app.signed-shallow/Contents/Info.plist
d                      MyApp.app.signed-shallow/Contents/MacOS
f ec0736200e9c8dc64954 MyApp.app.signed-shallow/Contents/MacOS/MyApp
d                      MyApp.app.signed-shallow/Contents/_CodeSignature
f 90443605a8872c4b12b6 MyApp.app.signed-shallow/Contents/_CodeSignature/CodeResources
d                      MyApp.app.signed-shallow/Contents/lib
d                      MyApp.app.signed-shallow/Contents/lib/foo
d                      MyApp.app.signed-shallow/Contents/lib/foo/child.app
d                      MyApp.app.signed-shallow/Contents/lib/foo/child.app/Contents
f 4c5130ae58d7184aa747 MyApp.app.signed-shallow/Contents/lib/foo/child.app/Contents/Info.plist
d                      MyApp.app.signed-shallow/Contents/lib/foo/child.app/Contents/MacOS
f 4cfaf70bc9fb6827fcf7 MyApp.app.signed-shallow/Contents/lib/foo/child.app/Contents/MacOS/child
f 4cfaf70bc9fb6827fcf7 MyApp.app.signed-shallow/Contents/lib/foo/child.app/Contents/MacOS/extra-exe
f 4cfaf70bc9fb6827fcf7 MyApp.app.signed-shallow/Contents/lib/foo/exe

$ rcodesign print-signature-info MyApp.app.signed-shallow
- path: Contents/Info.plist
  file_size: 576
  file_sha256: 0a5902dc8e47f490d03889d3593d17bddbf79e6c1f79494e20dd28f9459effa5
  entity: other
- path: Contents/MacOS/MyApp
  file_size: 22544
  file_sha256: ec0736200e9c8dc64954a17c80f6ed556e5bc4795120a24f2fae5490a6cdc1b4
  entity:
    mach_o:
      macho_linkedit_start_offset: 16384 / 0x4000
      macho_signature_start_offset: 16400 / 0x4010
      macho_signature_end_offset: 16821 / 0x41b5
      macho_linkedit_end_offset: 22544 / 0x5810
      macho_end_offset: 22544 / 0x5810
      linkedit_signature_start_offset: 16 / 0x10
      linkedit_signature_end_offset: 437 / 0x1b5
      linkedit_bytes_after_signature: 5723 / 0x165b
      signature:
        superblob_length: 421 / 0x1a5
        blob_count: 3
        blobs:
        - slot: CodeDirectory (0)
          magic: fade0c02
          length: 365
          sha1: 91fbe54adddc8de02772732e2eed09cde141c39c
          sha256: c06b7ef1263aea0fd7b10cadb9f1557ef1d3117662b839499da4a3529d99fcd3
        - slot: RequirementSet (2)
          magic: fade0c01
          length: 12
          sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973
          sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986
        - slot: CMS Signature (65536)
          magic: fade0b01
          length: 8
          sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b
          sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0
        code_directory:
          version: '0x20400'
          flags: CodeSignatureFlags(ADHOC)
          identifier: com.example.mybundle
          digest_type: sha256
          platform: 0
          signed_entity_size: 16400
          executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY)
          code_digests_count: 5
          slot_digests:
          - 'Info (1): 0a5902dc8e47f490d03889d3593d17bddbf79e6c1f79494e20dd28f9459effa5'
          - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986'
          - 'Resources (3): 90443605a8872c4b12b6b0a86cd50b2e5101b245e156ee3d3a8787686b77aa92'
        cms: null
- path: Contents/_CodeSignature/CodeResources
  file_size: 2824
  file_sha256: 90443605a8872c4b12b6b0a86cd50b2e5101b245e156ee3d3a8787686b77aa92
  entity:
    bundle_code_signature_file: !ResourcesXml
    - <?xml version="1.0" encoding="UTF-8"?>
    - <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    - <plist version="1.0">
    - <dict>
    - '  <key>files</key>'
    - '  <dict/>'
    - '  <key>files2</key>'
    - '  <dict>'
    - '    <key>lib/foo/child.app/Contents/Info.plist</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      TFEwrljXGEqnR7LZD/HiHXVCvWvV3ZQjm+Lphz/9pZ4='
    - '      </data>'
    - '    </dict>'
    - '    <key>lib/foo/child.app/Contents/MacOS/child</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      TPr3C8n7aCf893Ud6vZfi1TUb+y285yyuo+882kSQww='
    - '      </data>'
    - '    </dict>'
    - '    <key>lib/foo/child.app/Contents/MacOS/extra-exe</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      TPr3C8n7aCf893Ud6vZfi1TUb+y285yyuo+882kSQww='
    - '      </data>'
    - '    </dict>'
    - '    <key>lib/foo/exe</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      TPr3C8n7aCf893Ud6vZfi1TUb+y285yyuo+882kSQww='
    - '      </data>'
    - '    </dict>'
    - '  </dict>'
    - '  <key>rules</key>'
    - '  <dict>'
    - '    <key>^Resources/</key>'
    - '    <true/>'
    - '    <key>^Resources/.*/.lproj/</key>'
    - '    <dict>'
    - '      <key>optional</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1000</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/locversion.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1100</real>'
    - '    </dict>'
    - '    <key>^Resources/Base/.lproj/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>1010</real>'
    - '    </dict>'
    - '    <key>^version.plist$</key>'
    - '    <true/>'
    - '  </dict>'
    - '  <key>rules2</key>'
    - '  <dict>'
    - '    <key>.*/.dSYM($|/)</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>11</real>'
    - '    </dict>'
    - '    <key>^(.*/)?/.DS_Store$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>2000</real>'
    - '    </dict>'
    - '    <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>'
    - '    <dict>'
    - '      <key>nested</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>10</real>'
    - '    </dict>'
    - '    <key>^.*</key>'
    - '    <true/>'
    - '    <key>^Info/.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^PkgInfo$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^Resources/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/</key>'
    - '    <dict>'
    - '      <key>optional</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1000</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/locversion.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1100</real>'
    - '    </dict>'
    - '    <key>^Resources/Base/.lproj/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>1010</real>'
    - '    </dict>'
    - '    <key>^[^/]+$</key>'
    - '    <dict>'
    - '      <key>nested</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>10</real>'
    - '    </dict>'
    - '    <key>^embedded/.provisionprofile$</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^version/.plist$</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '  </dict>'
    - </dict>
    - </plist>
    - ''
- path: Contents/lib/foo/child.app/Contents/Info.plist
  file_size: 576
  file_sha256: 4c5130ae58d7184aa747b2d90ff1e21d7542bd6bd5dd94239be2e9873ffda59e
  entity: other
- path: Contents/lib/foo/child.app/Contents/MacOS/child
  file_size: 16386
  file_sha256: 4cfaf70bc9fb6827fcf7751deaf65f8b54d46fecb6f39cb2ba8fbcf36912430c
  entity:
    mach_o:
      macho_linkedit_start_offset: null
      macho_signature_start_offset: null
      macho_signature_end_offset: null
      macho_linkedit_end_offset: null
      macho_end_offset: 16386 / 0x4002
      linkedit_signature_start_offset: null
      linkedit_signature_end_offset: null
      linkedit_bytes_after_signature: null
      signature: null
- path: Contents/lib/foo/child.app/Contents/MacOS/extra-exe
  file_size: 16386
  file_sha256: 4cfaf70bc9fb6827fcf7751deaf65f8b54d46fecb6f39cb2ba8fbcf36912430c
  entity:
    mach_o:
      macho_linkedit_start_offset: null
      macho_signature_start_offset: null
      macho_signature_end_offset: null
      macho_linkedit_end_offset: null
      macho_end_offset: 16386 / 0x4002
      linkedit_signature_start_offset: null
      linkedit_signature_end_offset: null
      linkedit_bytes_after_signature: null
      signature: null
- path: Contents/lib/foo/exe
  file_size: 16386
  file_sha256: 4cfaf70bc9fb6827fcf7751deaf65f8b54d46fecb6f39cb2ba8fbcf36912430c
  entity:
    mach_o:
      macho_linkedit_start_offset: null
      macho_signature_start_offset: null
      macho_signature_end_offset: null
      macho_linkedit_end_offset: null
      macho_end_offset: 16386 / 0x4002
      linkedit_signature_start_offset: null
      linkedit_signature_end_offset: null
      linkedit_bytes_after_signature: null
      signature: null

$ rcodesign sign MyApp.app
signing MyApp.app in place
signing bundle at MyApp.app
signing 1 nested bundles in the following order:
Contents/lib/foo/child.app
entering nested bundle Contents/lib/foo/child.app
signing bundle at MyApp.app/Contents/lib/foo/child.app into MyApp.app/Contents/lib/foo/child.app
signing Mach-O file Contents/MacOS/extra-exe
signing main executable Contents/MacOS/child
leaving nested bundle Contents/lib/foo/child.app
signing bundle at MyApp.app into MyApp.app
signing Mach-O file Contents/lib/foo/exe
signing main executable Contents/MacOS/MyApp

$ rcodesign debug-file-tree MyApp.app
d                      MyApp.app/
d                      MyApp.app/Contents
f 0a5902dc8e47f490d038 MyApp.app/Contents/Info.plist
d                      MyApp.app/Contents/MacOS
f e07ea4755d1135f15295 MyApp.app/Contents/MacOS/MyApp
d                      MyApp.app/Contents/_CodeSignature
f 48a72e1777660495d9fc MyApp.app/Contents/_CodeSignature/CodeResources
d                      MyApp.app/Contents/lib
d                      MyApp.app/Contents/lib/foo
d                      MyApp.app/Contents/lib/foo/child.app
d                      MyApp.app/Contents/lib/foo/child.app/Contents
f 4c5130ae58d7184aa747 MyApp.app/Contents/lib/foo/child.app/Contents/Info.plist
d                      MyApp.app/Contents/lib/foo/child.app/Contents/MacOS
f 8d2bb481b183bd66403b MyApp.app/Contents/lib/foo/child.app/Contents/MacOS/child
f d4637e70eed799f72544 MyApp.app/Contents/lib/foo/child.app/Contents/MacOS/extra-exe
d                      MyApp.app/Contents/lib/foo/child.app/Contents/_CodeSignature
f 164aae2ea1c61b76cd81 MyApp.app/Contents/lib/foo/child.app/Contents/_CodeSignature/CodeResources
f 2adcd25a21eb14fc3f7b MyApp.app/Contents/lib/foo/exe

$ rcodesign print-signature-info MyApp.app
- path: Contents/Info.plist
  file_size: 576
  file_sha256: 0a5902dc8e47f490d03889d3593d17bddbf79e6c1f79494e20dd28f9459effa5
  entity: other
- path: Contents/MacOS/MyApp
  file_size: 22544
  file_sha256: e07ea4755d1135f15295324ef4e2d21506ef74a7a95542f56cd659f46c3f886a
  entity:
    mach_o:
      macho_linkedit_start_offset: 16384 / 0x4000
      macho_signature_start_offset: 16400 / 0x4010
      macho_signature_end_offset: 16821 / 0x41b5
      macho_linkedit_end_offset: 22544 / 0x5810
      macho_end_offset: 22544 / 0x5810
      linkedit_signature_start_offset: 16 / 0x10
      linkedit_signature_end_offset: 437 / 0x1b5
      linkedit_bytes_after_signature: 5723 / 0x165b
      signature:
        superblob_length: 421 / 0x1a5
        blob_count: 3
        blobs:
        - slot: CodeDirectory (0)
          magic: fade0c02
          length: 365
          sha1: 90ae5487cb1d55a65877d973aae4f73ddc8c6c85
          sha256: 2345e491269e624fcc0c1f3aa515702988c5739b69eef97df48cfa7b260fc27b
        - slot: RequirementSet (2)
          magic: fade0c01
          length: 12
          sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973
          sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986
        - slot: CMS Signature (65536)
          magic: fade0b01
          length: 8
          sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b
          sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0
        code_directory:
          version: '0x20400'
          flags: CodeSignatureFlags(ADHOC)
          identifier: com.example.mybundle
          digest_type: sha256
          platform: 0
          signed_entity_size: 16400
          executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY)
          code_digests_count: 5
          slot_digests:
          - 'Info (1): 0a5902dc8e47f490d03889d3593d17bddbf79e6c1f79494e20dd28f9459effa5'
          - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986'
          - 'Resources (3): 48a72e1777660495d9fce43e650c4f00ffe79977e30e4efeaee227b32eeef620'
        cms: null
- path: Contents/_CodeSignature/CodeResources
  file_size: 3001
  file_sha256: 48a72e1777660495d9fce43e650c4f00ffe79977e30e4efeaee227b32eeef620
  entity:
    bundle_code_signature_file: !ResourcesXml
    - <?xml version="1.0" encoding="UTF-8"?>
    - <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    - <plist version="1.0">
    - <dict>
    - '  <key>files</key>'
    - '  <dict/>'
    - '  <key>files2</key>'
    - '  <dict>'
    - '    <key>lib/foo/child.app/Contents/Info.plist</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      TFEwrljXGEqnR7LZD/HiHXVCvWvV3ZQjm+Lphz/9pZ4='
    - '      </data>'
    - '    </dict>'
    - '    <key>lib/foo/child.app/Contents/MacOS/child</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      jSu0gbGDvWZAO21MEqe6C7r9WFbXmTMk+kW/f203LT8='
    - '      </data>'
    - '    </dict>'
    - '    <key>lib/foo/child.app/Contents/MacOS/extra-exe</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      1GN+cO7XmfclRNEqlCdbwEu89NOQkcykJmFIUAsxj6g='
    - '      </data>'
    - '    </dict>'
    - '    <key>lib/foo/child.app/Contents/_CodeSignature/CodeResources</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      FkquLqHGG3bNgSCs6qerY1wKAVFGguBJvd44TXiPtnc='
    - '      </data>'
    - '    </dict>'
    - '    <key>lib/foo/exe</key>'
    - '    <dict>'
    - '      <key>hash2</key>'
    - '      <data>'
    - '      KtzSWiHrFPw/e1yk9UZbUV8hk53ZhD3lv32eP3rPqds='
    - '      </data>'
    - '    </dict>'
    - '  </dict>'
    - '  <key>rules</key>'
    - '  <dict>'
    - '    <key>^Resources/</key>'
    - '    <true/>'
    - '    <key>^Resources/.*/.lproj/</key>'
    - '    <dict>'
    - '      <key>optional</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1000</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/locversion.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1100</real>'
    - '    </dict>'
    - '    <key>^Resources/Base/.lproj/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>1010</real>'
    - '    </dict>'
    - '    <key>^version.plist$</key>'
    - '    <true/>'
    - '  </dict>'
    - '  <key>rules2</key>'
    - '  <dict>'
    - '    <key>.*/.dSYM($|/)</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>11</real>'
    - '    </dict>'
    - '    <key>^(.*/)?/.DS_Store$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>2000</real>'
    - '    </dict>'
    - '    <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>'
    - '    <dict>'
    - '      <key>nested</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>10</real>'
    - '    </dict>'
    - '    <key>^.*</key>'
    - '    <true/>'
    - '    <key>^Info/.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^PkgInfo$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^Resources/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/</key>'
    - '    <dict>'
    - '      <key>optional</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1000</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/locversion.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1100</real>'
    - '    </dict>'
    - '    <key>^Resources/Base/.lproj/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>1010</real>'
    - '    </dict>'
    - '    <key>^[^/]+$</key>'
    - '    <dict>'
    - '      <key>nested</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>10</real>'
    - '    </dict>'
    - '    <key>^embedded/.provisionprofile$</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^version/.plist$</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '  </dict>'
    - </dict>
    - </plist>
    - ''
- path: Contents/lib/foo/child.app/Contents/Info.plist
  file_size: 576
  file_sha256: 4c5130ae58d7184aa747b2d90ff1e21d7542bd6bd5dd94239be2e9873ffda59e
  entity: other
- path: Contents/lib/foo/child.app/Contents/MacOS/child
  file_size: 22544
  file_sha256: 8d2bb481b183bd66403b6d4c12a7ba0bbafd5856d7993324fa45bf7f6d372d3f
  entity:
    mach_o:
      macho_linkedit_start_offset: 16384 / 0x4000
      macho_signature_start_offset: 16400 / 0x4010
      macho_signature_end_offset: 16821 / 0x41b5
      macho_linkedit_end_offset: 22544 / 0x5810
      macho_end_offset: 22544 / 0x5810
      linkedit_signature_start_offset: 16 / 0x10
      linkedit_signature_end_offset: 437 / 0x1b5
      linkedit_bytes_after_signature: 5723 / 0x165b
      signature:
        superblob_length: 421 / 0x1a5
        blob_count: 3
        blobs:
        - slot: CodeDirectory (0)
          magic: fade0c02
          length: 365
          sha1: da2d1d20b15073dc7c0ea2b9bdf0265b1c60b9d7
          sha256: 5df5b910c1b35258c22d107a13dccdfad7f747d4c1d6726d72b54c264de1bd40
        - slot: RequirementSet (2)
          magic: fade0c01
          length: 12
          sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973
          sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986
        - slot: CMS Signature (65536)
          magic: fade0b01
          length: 8
          sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b
          sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0
        code_directory:
          version: '0x20400'
          flags: CodeSignatureFlags(ADHOC)
          identifier: com.example.mybundle
          digest_type: sha256
          platform: 0
          signed_entity_size: 16400
          executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY)
          code_digests_count: 5
          slot_digests:
          - 'Info (1): 4c5130ae58d7184aa747b2d90ff1e21d7542bd6bd5dd94239be2e9873ffda59e'
          - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986'
          - 'Resources (3): 164aae2ea1c61b76cd8120aceaa7ab635c0a01514682e049bdde384d788fb677'
        cms: null
- path: Contents/lib/foo/child.app/Contents/MacOS/extra-exe
  file_size: 22544
  file_sha256: d4637e70eed799f72544d12a94275bc04bbcf4d39091cca4266148500b318fa8
  entity:
    mach_o:
      macho_linkedit_start_offset: 16384 / 0x4000
      macho_signature_start_offset: 16400 / 0x4010
      macho_signature_end_offset: 16778 / 0x418a
      macho_linkedit_end_offset: 22544 / 0x5810
      macho_end_offset: 22544 / 0x5810
      linkedit_signature_start_offset: 16 / 0x10
      linkedit_signature_end_offset: 394 / 0x18a
      linkedit_bytes_after_signature: 5766 / 0x1686
      signature:
        superblob_length: 378 / 0x17a
        blob_count: 3
        blobs:
        - slot: CodeDirectory (0)
          magic: fade0c02
          length: 322
          sha1: 99068332ebb6b9cc3d9c9534835a7f6c12c434ee
          sha256: feb5492886d3537f86aead02ebd705a5a4eec2e656c28357a20fd814a34d8c06
        - slot: RequirementSet (2)
          magic: fade0c01
          length: 12
          sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973
          sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986
        - slot: CMS Signature (65536)
          magic: fade0b01
          length: 8
          sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b
          sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0
        code_directory:
          version: '0x20400'
          flags: CodeSignatureFlags(ADHOC)
          identifier: extra-exe
          digest_type: sha256
          platform: 0
          signed_entity_size: 16400
          executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY)
          code_digests_count: 5
          slot_digests:
          - 'Info (1): 0000000000000000000000000000000000000000000000000000000000000000'
          - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986'
        cms: null
- path: Contents/lib/foo/child.app/Contents/_CodeSignature/CodeResources
  file_size: 2427
  file_sha256: 164aae2ea1c61b76cd8120aceaa7ab635c0a01514682e049bdde384d788fb677
  entity:
    bundle_code_signature_file: !ResourcesXml
    - <?xml version="1.0" encoding="UTF-8"?>
    - <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    - <plist version="1.0">
    - <dict>
    - '  <key>files</key>'
    - '  <dict/>'
    - '  <key>files2</key>'
    - '  <dict>'
    - '    <key>MacOS/extra-exe</key>'
    - '    <dict>'
    - '      <key>cdhash</key>'
    - '      <data>'
    - '      /rVJKIbTU3+Grq0C69cFpaTuwuY='
    - '      </data>'
    - '      <key>requirement</key>'
    - '      <string>cdhash H"feb5492886d3537f86aead02ebd705a5a4eec2e6"</string>'
    - '    </dict>'
    - '  </dict>'
    - '  <key>rules</key>'
    - '  <dict>'
    - '    <key>^Resources/</key>'
    - '    <true/>'
    - '    <key>^Resources/.*/.lproj/</key>'
    - '    <dict>'
    - '      <key>optional</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1000</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/locversion.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1100</real>'
    - '    </dict>'
    - '    <key>^Resources/Base/.lproj/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>1010</real>'
    - '    </dict>'
    - '    <key>^version.plist$</key>'
    - '    <true/>'
    - '  </dict>'
    - '  <key>rules2</key>'
    - '  <dict>'
    - '    <key>.*/.dSYM($|/)</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>11</real>'
    - '    </dict>'
    - '    <key>^(.*/)?/.DS_Store$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>2000</real>'
    - '    </dict>'
    - '    <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>'
    - '    <dict>'
    - '      <key>nested</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>10</real>'
    - '    </dict>'
    - '    <key>^.*</key>'
    - '    <true/>'
    - '    <key>^Info/.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^PkgInfo$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^Resources/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/</key>'
    - '    <dict>'
    - '      <key>optional</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1000</real>'
    - '    </dict>'
    - '    <key>^Resources/.*/.lproj/locversion.plist$</key>'
    - '    <dict>'
    - '      <key>omit</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>1100</real>'
    - '    </dict>'
    - '    <key>^Resources/Base/.lproj/</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>1010</real>'
    - '    </dict>'
    - '    <key>^[^/]+$</key>'
    - '    <dict>'
    - '      <key>nested</key>'
    - '      <true/>'
    - '      <key>weight</key>'
    - '      <real>10</real>'
    - '    </dict>'
    - '    <key>^embedded/.provisionprofile$</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '    <key>^version/.plist$</key>'
    - '    <dict>'
    - '      <key>weight</key>'
    - '      <real>20</real>'
    - '    </dict>'
    - '  </dict>'
    - </dict>
    - </plist>
    - ''
- path: Contents/lib/foo/exe
  file_size: 22544
  file_sha256: 2adcd25a21eb14fc3f7b5ca4f5465b515f21939dd9843de5bf7d9e3f7acfa9db
  entity:
    mach_o:
      macho_linkedit_start_offset: 16384 / 0x4000
      macho_signature_start_offset: 16400 / 0x4010
      macho_signature_end_offset: 16772 / 0x4184
      macho_linkedit_end_offset: 22544 / 0x5810
      macho_end_offset: 22544 / 0x5810
      linkedit_signature_start_offset: 16 / 0x10
      linkedit_signature_end_offset: 388 / 0x184
      linkedit_bytes_after_signature: 5772 / 0x168c
      signature:
        superblob_length: 372 / 0x174
        blob_count: 3
        blobs:
        - slot: CodeDirectory (0)
          magic: fade0c02
          length: 316
          sha1: 4ca6f9ee2bfe2bfac44ab4e9e9c1ef9b6e4fc0de
          sha256: 23fc7207e52f23c0f6d2317dbb92cf9eff2aca8fe61ac241900d48be8f46cf5c
        - slot: RequirementSet (2)
          magic: fade0c01
          length: 12
          sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973
          sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986
        - slot: CMS Signature (65536)
          magic: fade0b01
          length: 8
          sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b
          sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0
        code_directory:
          version: '0x20400'
          flags: CodeSignatureFlags(ADHOC)
          identifier: exe
          digest_type: sha256
          platform: 0
          signed_entity_size: 16400
          executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY)
          code_digests_count: 5
          slot_digests:
          - 'Info (1): 0000000000000000000000000000000000000000000000000000000000000000'
          - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986'
        cms: null

```