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MuOJ1J4uTRxHoEGXCDRcuCn3RvT0civWEPpRNo1YVgAWFODpt/HSi3lCVtTb7FwJ
 hfHkxCpAuHmv3sfT8jcCwTTAXL1BLpCO6d0zz0RrFMNK+vGyZu/7LXhaYVu590Q5
 1DMybHmln7i+Tw/eYb4Avk1FWGOEpNdf3ZjUazcDlkO4EwA6BnZUC8gFvz0OI73D
 AJsGq/UsJvMH30ga1rZ/9LiHEMSEys5amk98yMRvi/R1qI02kjANdZ0ID/7cJSw2
 rVCCs61jgYppWv3JHVKYmm6+cVPAUcuRdsUzDpAQDdvGAaZJENE6suulRVEaBEdS
 8gM=
 -----END CERTIFICATE-----
EOF
cat > $tmpdir/entrycb2 <<- EOF
id=EntryCB2
ca_name=CAB2
EOF
cat > $tmpdir/entrycb3 <<- EOF
id=EntryCB3
ca_name=CAB3
cert_chain=Per-certificate Signing Authority CB3
 -----BEGIN CERTIFICATE-----
 MIIDjTCCAnWgAwIBAgIQOGalAgIuTw2xnRdbwbq4kTANBgkqhkiG9w0BAQsFADBQ
 MSAwHgYDVQQDDBdMb2NhbCBTaWduaW5nIEF1dGhvcml0eTEsMCoGA1UEAwwjMzg2
 NmE1MDItMDIyZTRmMGQtYjE5ZDE3NWItYzFiYWI4OTEwHhcNMTUwNDI4MTcxMjQw
 WhcNMTYwNDI4MTcxMjQwWjBQMSAwHgYDVQQDDBdMb2NhbCBTaWduaW5nIEF1dGhv
 cml0eTEsMCoGA1UEAwwjMzg2NmE1MDItMDIyZTRmMGQtYjE5ZDE3NWItYzFiYWI4
 OTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvWaesX7JlJsCn0emr
 ydLU7IwxQr9j+vbAEQW9haDQaUkQQLd5ScGZLJ6ZXFsoll0JOx22CUttmgqBInb/
 NceFnTVo8xcm3asF9iqLBTLN8Vhu8U3FF4fQFzM3QoqCL/z6JtN8axAhO6J1TRS4
 pKE1xQ3AYGL+l+1q29x3BE9ni61uqiF2b7Uw8VGxSg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V3Ecdr4Q4Y4SgMg4qwO0Lyv8xHeKUy6/aIp8wAgwMB3OWhXp1z2nIc+PfKCOY
 wgoDWGH6Xykl563eB7FHHasi+QgNo3WUttnWxCarNHWC9uI9ViaegJyd8olcYfZ9
 Za5zEjLP6kKvvL9K+oJqD3OPwuIvyG2iaMjpeA86Eq1Xq3UYu+idIRpVyd0/wDWy
 xQSVPzyJ8CXadgOXq8JMpzee5K7FJfdy7ZJ81exKSdageSCDJFnZBf0AMagoEe7T
 oB0=
 -----END CERTIFICATE-----
EOF
cat > $tmpdir/entryb1 <<- EOF
id=EntryB1
root_cert_files=$tmpdir/bundle1,$tmpdir/bundle-all
other_root_cert_files=
other_cert_files=
root_cert_dbs=
other_root_cert_dbs=
other_cert_dbs=
cert_roots=Per-certificate Signing Authority B1
 -----BEGIN CERTIFICATE-----
 MIIDjTCCAnWgAwIBAgIQcy6K0zk7T+KHmpn1Kn5fIzANBgkqhkiG9w0BAQsFADBQ
 MSAwHgYDVQQDDBdMb2NhbCBTaWduaW5nIEF1dGhvcml0eTEsMCoGA1UEAwwjNzMy
 ZThhZDMtMzkzYjRmZTItODc5YTk5ZjUtMmE3ZTVmMjMwHhcNMTUwNDI4MTcyODIx
 WhcNMTYwNDI4MTcyODIxWjBQMSAwHgYDVQQDDBdMb2NhbCBTaWduaW5nIEF1dGhv
 cml0eTEsMCoGA1UEAwwjNzMyZThhZDMtMzkzYjRmZTItODc5YTk5ZjUtMmE3ZTVm
 MjMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTA0bSIotriPnrNGKx
 MTjYTyOfo+hVhU1pbBFy4Jw65J4CaRs+VDD261naIYocuBRDuex6qzbEH6zjZaIr
 SRgCy1GvNFc0qbwmbk/bwn+CzuluAGp6T8hwKkFvgouzlVvv4Wm9djYUwNIHiKZS
 WSL5u0huOP0L494ZjSDQZjzE16+S3K8VSM87gPoVs3pyFoJLoXrk0bDKJgFQTUal
 RZBrL81Hy1iYH/1TRDer+HJ2Tp6yBVXrTvfr0nI5F3gjqtg0ptTEL0glveA8/N4P
 WdcHytzjyi48oV8u7UjY8JJn69xl4YHAj7GPACcmumzsk20ShukF+75V9kiZXKda
 BJHdAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAQEwHQYDVR0OBBYEFMp0soG+y9sG
 P3OWYDkFX7Mi6OraMB8GA1UdIwQYMBaAFMp0soG+y9sGP3OWYDkFX7Mi6OraMA4G
 A1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAQEAEVG8I00ag4U0AtugUJvC
 pyqcCRXu/hFW5N/bhsrSjDbmJ/PkgkuLlyhomQNHqKQ7MFgiXLJUSw80b4tgzX9m
 WPrk7G4sowTRAsuDGggfEYn/mM9avl+67xmINhu9UzIVpHk4RIupB0fpFkWnKq79
 c1OiqadkPckGzrS1c/OJeUGtbqFSjcJg9567usoNCeoP6ynKmzBScPFYfuviDlHe
 HverVItW9tiiDJekXdtqyYw6CjY6BED1b7Yiq+rNiyT+htSUwup4Kpk0z9uD9LdJ
 gDacgbTcTGY9u2hxRcmro12Y9N0nFUu2DWRzd/0F9pwkVACGkwrdedihPyOTB9+q
 aQ==
 -----END CERTIFICATE-----
EOF
cat > $tmpdir/entryb2 <<- EOF
id=EntryB2
root_cert_files=
other_root_cert_files=$tmpdir/bundle2,$tmpdir/bundle-all
other_cert_files=
root_cert_dbs=
other_root_cert_dbs=
other_cert_dbs=
EOF
cat > $tmpdir/entryb3 <<- EOF
id=EntryB3
root_cert_files=
other_root_cert_files=
other_cert_files=$tmpdir/bundle3,$tmpdir/bundle-all
root_cert_dbs=
other_root_cert_dbs=
other_cert_dbs=
cert_chain=Per-certificate Signing Authority B3
 -----BEGIN CERTIFICATE-----
 MIIDjTCCAnWgAwIBAgIQCUTKr/c7QTynRTku+4+EoTANBgkqhkiG9w0BAQsFADBQ
 MSAwHgYDVQQDDBdMb2NhbCBTaWduaW5nIEF1dGhvcml0eTEsMCoGA1UEAwwjMDk0
 NGN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OmgP8UHiN+lv5yx7kbmcbSiNV6oCzsKVr4BLdv75q4nfAzkGdt
 dg==
 -----END CERTIFICATE-----
EOF
cat > $tmpdir/entryd1 <<- EOF
id=EntryD1
root_cert_files=
other_root_cert_files=
other_cert_files=
root_cert_dbs=$scheme:$tmpdir/db1,$scheme:$tmpdir/dba
other_root_cert_dbs=
other_cert_dbs=
cert_roots=Per-certificate Signing Authority D1
 -----BEGIN CERTIFICATE-----
 MIIDjjCCAnagAwIBAgIRAIJ7pK4n4k0wlywp5+Qf0+UwDQYJKoZIhvcNAQELBQAw
 UDEgMB4GA1UEAwwXTG9jYWwgU2lnbmluZyBBdXRob3JpdHkxLDAqBgNVBAMMIzgy
 N2JhNGFlLTI3ZTI0ZDMwLTk3MmMyOWU3LWU0MWZkM2U1MB4XDTE1MDQyODE3NTA0
 MloXDTE2MDQyODE3NTA0MlowUDEgMB4GA1UEAwwXTG9jYWwgU2lnbmluZyBBdXRo
 b3JpdHkxLDAqBgNVBAMMIzgyN2JhNGFlLTI3ZTI0ZDMwLTk3MmMyOWU3LWU0MWZk
 M2U1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqsk9/knrBbt7TXSy
 Z0syp71ttOzLAc/r58aFPfeKcigc7aNxrZLC8CBq/6eHfvvxGtJtprvMTj1YchU6
 u/swCXeuGnvom43ctIOciZ9ZDbUtV6faPm4Wx6GafA3fZTlpnph+a/6Xu6sHjxru
 MbZ063zwBYVtgDREMcqgjBNGkqtHxcnn1x9uJ9jAzf/w96Pd3TUZXfaK/LWniQZV
 5t6weHTycKQdHdzMCSIK9tvrBX2zJoLyhdw9Ho3RND9N0o0nElsWPaVAENqY28lg
 DGQYDT9T0gqLFSFrK7jwvC2/XL27u26HraqNGbm923PSc+6qI67/jd/wVP1+ZiOC
 S+gjMQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQEBMB0GA1UdDgQWBBQzDtXEERJI
 RUXIib9KvQB4KHw8WTAfBgNVHSMEGDAWgBQzDtXEERJIRUXIib9KvQB4KHw8WTAO
 BgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggEBAJl8jG5musQ0Jby+LVLw
 OsdbgZicblDFnId4tYNANbZmy1q9Ou0fkV8TAQMbKWizSKkwhn2QFUsr5cyLpcMV
 zbVwyedE95QWL63NfWOfAWUs9yZcIjxC9xFsQ0dVisFM52X5fVmzxyM9qaZ2kIUD
 I/k3dt6GX/btw5LWiKarzOUvHnIcgUd8Ve06RTsfNzLKpSjSVHxv2Fx2q1i7E2Wh
 jiGcdiYdICM2ZL9AiiXF8l0juXU2LchwCkrmpNQKptKLzTXuOava3weWscubGU6r
 T0Q44wD5uQgN3DzJR3Ds4mD5astMjkOzqCCmOIsbuvXjoFKX6y3kq6pd08D+Gr/s
 kfY=
 -----END CERTIFICATE-----
EOF
cat > $tmpdir/entryd2 <<- EOF
id=EntryD2
root_cert_files=
other_root_cert_files=
other_cert_files=
root_cert_dbs=
other_root_cert_dbs=$scheme:$tmpdir/db2,$scheme:$tmpdir/dba
other_cert_dbs=
EOF
cat > $tmpdir/entryd3 <<- EOF
id=EntryD3
root_cert_files=
other_root_cert_files=
other_cert_files=
root_cert_dbs=
other_root_cert_dbs=
other_cert_dbs=$scheme:$tmpdir/db3,$scheme:$tmpdir/dba
cert_chain=Per-certificate Signing Authority D3
 -----BEGIN CERTIFICATE-----
 MIIDjjCCAnagAwIBAgIRALuVK2FuXklPuMP4qtRyQjUwDQYJKoZIhvcNAQELBQAw
 UDEgMB4GA1UEAwwXTG9jYWwgU2lnbmluZyBBdXRob3JpdHkxLDAqBgNVBAMMI2Ji
 OTUyYjYxLTZlNWU0OTRmLWI4YzNmOGFhLWQ0NzI0MjM1MB4XDTE1MDQyODE3NTEx
 OFoXDTE2MDQyODE3NTExOFowUDEgMB4GA1UEAwwXTG9jYWwgU2lnbmluZyBBdXRo
 b3JpdHkxLDAqBgNVBAMMI2JiOTUyYjYxLTZlNWU0OTRmLWI4YzNmOGFhLWQ0NzI0
 MjM1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzhejaX5gRYuQLRFm
 8Tq97akBa/asJPlxUrh1Vh+lKeXH+yqlPnkWoHaURn0UKj8Q26yTh3ENrqESoUrW
 JM8iR1tN4e7t1M3GGvscQOoVq7zdQ1CrGbwvd+Pdz0QTHzIEwzts2hfh6T65a0HG
 phGpS6EAxS5G8Sz8ppbqxgfynqLAYes2tBHvio0KFYpejbVzbxibE2NtMDULyF2p
 Nn18Vv8aoD1I9TbSmAKsp5ToUwc4P2xKCaZ0nzlVGZaH2UXdblKc1Y8wNRs+fQ0G
 PBzjDSLYCkU52jDSFf6+lNBybHJkDDntOlRje0B0Yb+AfDO7Yl/G4h5Yth9F17mB
 68R/0wIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQEBMB0GA1UdDgQWBBQ7Udp0Ln9Z
 Tac97VONJO6RYcZ4jTAfBgNVHSMEGDAWgBQ7Udp0Ln9ZTac97VONJO6RYcZ4jTAO
 BgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggEBAMHg38+LFUh86abJXZ5P
 rZE4i7Jn6mT+fIboQgZsrxn0vLXOGFBNSNhmNBp3scDY/+CzO+lE27jfGphFtJ2z
 R/vocPjS34BbNWkEBkCPv4lUYNL2yyPWM1SeOi7f/znyi7CbaAfvMz82mS8KAXep
 Ysd+GvmZCMcClOXjyoSYV+3757o1n7OvOQIBnbymH+DjLE/Dcg09oahUBtV/NS0D
 eGXlp39JJu6MxuAeooHDdsOPTaociNDMbJiXTC1RGqjhSXyaneZp3B01SQgMD/8N
 8nOg4kHgV181Zg4imvWK4qnaoHZeTcTgkd8MNjXeAq/OSppGQw5W5vuZ1dOTSUPR
 44A=
 -----END CERTIFICATE-----
EOF
cat > $tmpdir/entrycab1 <<- EOF
id=EntryCAB1
ca_name=CAB1
root_cert_files=$tmpdir/bundle1,$tmpdir/bundle-all
other_root_cert_files=
other_cert_files=
root_cert_dbs=
other_root_cert_dbs=
other_cert_dbs=
EOF
cat > $tmpdir/entrycab2 <<- EOF
id=EntryCAB2
ca_name=CAB2
root_cert_files=
other_root_cert_files=$tmpdir/bundle2,$tmpdir/bundle-all
other_cert_files=
root_cert_dbs=
other_root_cert_dbs=
other_cert_dbs=
EOF
cat > $tmpdir/entrycab3 <<- EOF
id=EntryCAB3
ca_name=CAB3
root_cert_files=
other_root_cert_files=
other_cert_files=$tmpdir/bundle3,$tmpdir/bundle-all
root_cert_dbs=
other_root_cert_dbs=
other_cert_dbs=
EOF
cat > $tmpdir/entrycad1 <<- EOF
id=EntryCAD1
ca_name=CAD1
root_cert_files=
other_root_cert_files=
other_cert_files=
root_cert_dbs=$scheme:$tmpdir/db1,$scheme:$tmpdir/dba
other_root_cert_dbs=
other_cert_dbs=
EOF
cat > $tmpdir/entrycad2 <<- EOF
id=EntryCAD2
ca_name=CAD2
root_cert_files=
other_root_cert_files=
other_cert_files=
root_cert_dbs=
other_root_cert_dbs=$scheme:$tmpdir/db2,$scheme:$tmpdir/dba
other_cert_dbs=
EOF
cat > $tmpdir/entrycad3 <<- EOF
id=EntryCAD3
ca_name=CAD3
root_cert_files=
other_root_cert_files=
other_cert_files=
root_cert_dbs=
other_root_cert_dbs=
other_cert_dbs=$scheme:$tmpdir/db3,$scheme:$tmpdir/dba
EOF

cat > $tmpdir/cab1 <<- EOF
id=CAB1
ca_type=EXTERNAL
ca_external_helper=$tmpdir/no-such-helper.sh
ca_root_cert_files=$tmpdir/bundle1,$tmpdir/bundle-all
ca_other_root_cert_files=
ca_other_cert_files=
ca_root_cert_dbs=
ca_other_root_cert_dbs=
ca_other_cert_dbs=
ca_root_certs=Root Certificate B1
 -----BEGIN CERTIFICATE-----
 MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJB
 VDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBp
 bSBl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EOF
cat > $tmpdir/cab2 <<- EOF
id=CAB2
ca_type=EXTERNAL
ca_external_helper=$tmpdir/no-such-helper.sh
ca_root_cert_files=
ca_other_root_cert_files=$tmpdir/bundle2,$tmpdir/bundle-all
ca_other_cert_files=
ca_root_cert_dbs=
ca_other_root_cert_dbs=
ca_other_cert_dbs=
ca_root_certs=Root Certificate B2
 -----BEGIN CERTIFICATE-----
 MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE
 BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz
 dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL
 MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp
 cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
 AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP
 Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr
 ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL
 MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1
 yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr
 VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/
 nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ
 KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03T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EB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs
 aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I
 flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ==
 -----END CERTIFICATE-----
EOF
cat > $tmpdir/cab3 <<- EOF
id=CAB3
ca_type=EXTERNAL
ca_external_helper=$tmpdir/no-such-helper.sh
ca_root_cert_files=
ca_other_root_cert_files=
ca_other_cert_files=$tmpdir/bundle3,$tmpdir/bundle-all
ca_root_cert_dbs=
ca_other_root_cert_dbs=
ca_other_cert_dbs=
ca_root_certs=Root Certificate B3
 -----BEGIN CERTIFICATE-----
 MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc
 MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP
 bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2
 MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft
 ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg
 Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP
 ADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lk
 hsmj76CGv2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym
 1BW32J/X3HGrfpq/m44zDyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsW
 OqMFf6Dch9Wc/HKpoH145LcxVR5lu9RhsCFg7RAycsWSJR74kEoYeEfffjA3PlAb
 2xzTa5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sTdBQrC6YB3y/gkRsPCHe6ed
 -----END CERTIFICATE-----
EOF
cat > $tmpdir/cad1 <<- EOF
id=CAD1
ca_type=EXTERNAL
ca_external_helper=$tmpdir/no-such-helper.sh
ca_root_cert_files=
ca_other_root_cert_files=
ca_other_cert_files=
ca_root_cert_dbs=$scheme:$tmpdir/db1,$scheme:$tmpdir/dba
ca_other_root_cert_dbs=$scheme:$tmpdir/dba
ca_other_cert_dbs=$scheme:$tmpdir/dba
ca_root_certs=Root Certificate D1
 -----BEGIN CERTIFICATE-----
 MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ
 RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD
 VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX
 DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y
 ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy
 VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr
 mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr
 IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK
 mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu
 XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy
 dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye
 jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIV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ELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//z
 NIqeKNc0n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI
 +MkcVyzwPX6UvCWThOiaAJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2R
 hzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+
 mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNCMEAwDwYDVR0TAQH/BAUw
 AwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0PAQH/BAQD
 AgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFP
 Bdy7pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27s
 EzNxZy5p+qksP2bAEllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2
 mSlf56oBzKwzqBwKu5HEA6BvtjT5htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yC
 e/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQjel/wroQk5PMr+4okoyeYZdow
 dXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915
 -----END CERTIFICATE-----
EOF
cat > $tmpdir/cad2 <<- EOF
id=CAD2
ca_type=EXTERNAL
ca_external_helper=$tmpdir/no-such-helper.sh
ca_root_cert_files=
ca_other_root_cert_files=
ca_other_cert_files=
ca_root_cert_dbs=$scheme:$tmpdir/dba
ca_other_root_cert_dbs=$scheme:$tmpdir/db2,$scheme:$tmpdir/dba
ca_other_cert_dbs=$scheme:$tmpdir/dba
ca_root_certs=Root Certificate D2
 -----BEGIN CERTIFICATE-----
 MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9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
ca_other_cert_files=
ca_root_cert_dbs=,$scheme:$tmpdir/dba
ca_other_root_cert_dbs=,$scheme:$tmpdir/dba,
ca_other_cert_dbs=$scheme:$tmpdir/db3,$scheme:$tmpdir/dba
ca_root_certs=Root Certificate D3
 -----BEGIN CERTIFICATE-----
 MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL
 MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
 BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT
 IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw
 MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy
 ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N
 T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv
 biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR
 FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J
 cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW
 BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/
 BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm
 fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv
 GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=
 -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AsGA1Ud
 DwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJYIZIAYb4
 QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMu
 Y29tL0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/
 AN9WM2K191EBkOvDP9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8
 yfFC82x/xXp8HVGIutIKPidd3i1RTtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMR
 FcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+7UCmnYR0ObncHoUW2ikbhiMA
 ybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW//1IMwrh3KWB
 kJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7
 l7+ijrRU
 -----END CERTIFICATE-----
EOF
cat > $tmpdir/cada <<- EOF
id=CADA
ca_type=EXTERNAL
ca_external_helper=$tmpdir/no-such-helper.sh
ca_root_cert_files=$tmpdir/bundle-all
ca_other_root_cert_files=
ca_other_cert_files=
ca_root_cert_dbs=$scheme:$tmpdir/dba
ca_other_root_cert_dbs=,$scheme:$tmpdir/dba
ca_other_cert_dbs=,$scheme:$tmpdir/dba
ca_root_certs=Root Certificate DA
 -----BEGIN CERTIFICATE-----
 MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL
 MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp
 IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi
 BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw
 MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh
 d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig
 YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v
 dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/
 BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6
 papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E
 BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K
 DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3
 KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox
 XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==
 -----END CERTIFICATE-----
EOF

entries=" -e entryb1 -e entryb2 -e entryb3 -e entryd1 -e entryd2 -e entryd3"
centries=" -e entrycb1 -e entrycb2 -e entrycb3 -e entrycd1 -e entrycd2 -e entrycd3"
caentries=" -e entrycab1 -e entrycab2 -e entrycab3 -e entrycad1 -e entrycad2 -e entrycad3"
cas=" -c cab1 -c cab2 -c cab3 -c cad1 -c cad2 -c cad3 -c cada"

for which in CAB1 CAB2 CAB3 CAD1 CAD2 CAD3 EntryB1 EntryB2 EntryB3 EntryD1 EntryD2 EntryD3 EntryCB1 EntryCB2 EntryCB3 EntryCD1 EntryCD2 EntryCD3 EntryCAB1 EntryCAB2 EntryCAB3 EntryCAD1 EntryCAD2 EntryCAD3 ; do
	echo "[($which)]"
	rm -f $tmpdir/bundle1 $tmpdir/bundle2 $tmpdir/bundle3 $tmpdir/bundle-all
	rm -fr $tmpdir/db1 $tmpdir/db2 $tmpdir/db3 $tmpdir/dba
	mkdir $tmpdir/db1 $tmpdir/db2 $tmpdir/db3 $tmpdir/dba
	$toolsdir/casave $entries $centries $caentries $cas $which
	for bundle in 1 2 3 -all ; do
		echo "[bundle$bundle]"
		touch "bundle$bundle"
		cat "bundle$bundle" > "oldbundle$bundle"
		if test `grep 'BEGIN CERTIFICATE-----' "bundle$bundle" | wc -l` \
			-ne `grep 'END CERTIFICATE-----' "bundle$bundle" | wc -l` ; then
			echo Storage error: possibly-truncated certs in "bundle$bundle".
			cat "bundle$bundle"
			exit 1
		fi
		grep 'BEGIN CERTIFICATE-----' "bundle$bundle" | wc -l
	done
	for db in 1 2 3 a ; do
		echo "[db$db]"
		certutil -L -d "$scheme:db$db" 2> /dev/null | \
		grep , | grep -v JAR/XPI | sed -r 's, +, ,g' | \
		env LANG=C sort | tee "olddblist$db"
	done
	$toolsdir/casave $entries $centries $caentries $cas $which
	for bundle in 1 2 3 -all ; do
		diff -u "bundle$bundle" "oldbundle$bundle"
	done
	for db in 1 2 3 a ; do
		certutil -L -d "$scheme:db$db" 2> /dev/null | \
		grep , | grep -v JAR/XPI | sed -r 's, +, ,g' | \
		env LANG=C sort > "dblist$db"
		diff -u "olddblist$db" "dblist$db"
	done
	echo
done

echo OK.
