|
| 1 | +#!/bin/bash |
| 2 | +echo '' > roots.pem |
| 3 | + |
| 4 | +for filename in *.0 |
| 5 | +do |
| 6 | + |
| 7 | + is_amazon=$(openssl x509 -in $filename -text -nocert | grep "O = Amazon") |
| 8 | + is_google=$(openssl x509 -in $filename -text -nocert | grep "O = Google Trust Services LLC") |
| 9 | + is_comodo=$(openssl x509 -in $filename -text -nocert | grep "O = Comodo CA Limited") |
| 10 | + is_comodo_uppercase=$(openssl x509 -in $filename -text -nocert | grep "O = COMODO CA Limited") |
| 11 | + is_digicert=$(openssl x509 -in $filename -text -nocert | grep "O = DigiCert") |
| 12 | + is_isrg=$(openssl x509 -in $filename -text -nocert | grep "O = Internet Security Research Group") |
| 13 | + is_verisign=$(openssl x509 -in $filename -text -nocert | grep "O = \"VeriSign, Inc.\"") |
| 14 | + is_baltimore=$(openssl x509 -in $filename -text -nocert | grep "O = Baltimore") |
| 15 | + is_globalsign=$(openssl x509 -in $filename -text -nocert | grep "O = GlobalSign") |
| 16 | + is_starfield=$(openssl x509 -in $filename -text -nocert | grep "O = \"Starfield Technologies, Inc.\"") |
| 17 | + is_dst=$(openssl x509 -in $filename -text -nocert | grep "O = Digital Signature Trust Co.") |
| 18 | + is_cybertrust=$(openssl x509 -in $filename -text -nocert | grep "O = \"Cybertrust, Inc\"") |
| 19 | + is_usertrust=$(openssl x509 -in $filename -text -nocert | grep "O = The USERTRUST Network") |
| 20 | + |
| 21 | + openssl_opts="-text -certopt no_header,no_pubkey,no_subject,no_issuer,no_signame,no_version,no_serial,no_validity,no_extensions,no_sigdump,no_aux,no_extensions" |
| 22 | + |
| 23 | + if [ ! -z "$is_amazon" ] |
| 24 | + then |
| 25 | + echo $is_amazon |
| 26 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 27 | + fi |
| 28 | + |
| 29 | + if [ ! -z "$is_google" ] |
| 30 | + then |
| 31 | + echo $is_google |
| 32 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 33 | + fi |
| 34 | + |
| 35 | + if [ ! -z "$is_comodo_uppercase" ] |
| 36 | + then |
| 37 | + echo $is_comodo_uppercase |
| 38 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 39 | + fi |
| 40 | + |
| 41 | + if [ ! -z "$is_comodo" ] |
| 42 | + then |
| 43 | + echo $is_comodo |
| 44 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 45 | + fi |
| 46 | + |
| 47 | + if [ ! -z "$is_digicert" ] |
| 48 | + then |
| 49 | + echo $is_digicert |
| 50 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 51 | + fi |
| 52 | + |
| 53 | + if [ ! -z "$is_isrg" ] |
| 54 | + then |
| 55 | + echo $is_isrg |
| 56 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 57 | + fi |
| 58 | + |
| 59 | + if [ ! -z "$is_verisign" ] |
| 60 | + then |
| 61 | + echo $is_verisign |
| 62 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 63 | + fi |
| 64 | + |
| 65 | + if [ ! -z "$is_baltimore" ] |
| 66 | + then |
| 67 | + echo $is_baltimore |
| 68 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 69 | + fi |
| 70 | + |
| 71 | + if [ ! -z "$is_globalsign" ] |
| 72 | + then |
| 73 | + echo $is_globalsign |
| 74 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 75 | + fi |
| 76 | + |
| 77 | + if [ ! -z "$is_starfield" ] |
| 78 | + then |
| 79 | + echo $is_starfield |
| 80 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 81 | + fi |
| 82 | + |
| 83 | + if [ ! -z "$is_dst" ] |
| 84 | + then |
| 85 | + echo $is_dst |
| 86 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 87 | + fi |
| 88 | + |
| 89 | + if [ ! -z "$is_cybertrust" ] |
| 90 | + then |
| 91 | + echo $is_cybertrust |
| 92 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 93 | + fi |
| 94 | + |
| 95 | + if [ ! -z "$is_usertrust" ] |
| 96 | + then |
| 97 | + echo $is_usertrust |
| 98 | + openssl x509 -in $filename $openssl_opts >> roots.pem |
| 99 | + fi |
| 100 | + |
| 101 | +done |
0 commit comments