|
4 | 4 | APPLE_CERT_DEVELOPER_INSTALLER="apple_dev_installer_cert.p12"
|
5 | 5 | APPLE_CERT_DEVELOPER_APPLICATION="apple_dev_application_cert.p12"
|
6 | 6 |
|
| 7 | +# Define the expected MD5 checksum |
| 8 | +EXPECTED_INSTALLER_CHECKSUM="1f9d2dfd1a6dc87c87fe0426a6ee136e" |
| 9 | +EXPECTED_APPLICATION_CHECKSUM="658613e0abe5c3187284e9662f18e1f0" |
| 10 | + |
7 | 11 | # Decode Developer ID Installer certificate from base64 into temporary file
|
8 | 12 | base64 -d < $APPLE_CERT_DEVELOPER_INSTALLER_BASE64 > $APPLE_CERT_DEVELOPER_INSTALLER
|
9 | 13 |
|
10 |
| -# Check the checksum of the decoded Developer ID Installer certificate |
11 |
| -echo "1f9d2dfd1a6dc87c87fe0426a6ee136e $APPLE_CERT_DEVELOPER_INSTALLER" | md5sum -c - |
| 14 | +# Calculate the actual checksum of the decoded file |
| 15 | +ACTUAL_INSTALLER_CHECKSUM=$(md5 -q $APPLE_CERT_DEVELOPER_INSTALLER) |
| 16 | + |
| 17 | +# Compare the actual checksum with the expected one |
| 18 | +if [ "$ACTUAL_INSTALLER_CHECKSUM" == "$EXPECTED_INSTALLER_CHECKSUM" ]; then |
| 19 | + echo "$APPLE_CERT_DEVELOPER_INSTALLER: OK" |
| 20 | +else |
| 21 | + echo "$APPLE_CERT_DEVELOPER_INSTALLER: FAILED" |
| 22 | + exit 1 |
| 23 | +fi |
12 | 24 |
|
13 | 25 | # Decode Developer ID Application certificate from base64 into temporary file
|
14 | 26 | base64 -d < $APPLE_CERT_DEVELOPER_APPLICATION_BASE64 > $APPLE_CERT_DEVELOPER_APPLICATION
|
15 | 27 |
|
16 |
| -# Check the checksum of the decoded Developer ID Application certificate |
17 |
| -echo "658613e0abe5c3187284e9662f18e1f0 $APPLE_CERT_DEVELOPER_APPLICATION" | md5sum -c - |
| 28 | +# Calculate the actual checksum of the decoded file |
| 29 | +ACTUAL_APPLICATION_CHECKSUM=$(md5 -q $APPLE_CERT_DEVELOPER_APPLICATION) |
| 30 | + |
| 31 | +# Compare the actual checksum with the expected one |
| 32 | +if [ "$ACTUAL_APPLICATION_CHECKSUM" == "$EXPECTED_APPLICATION_CHECKSUM" ]; then |
| 33 | + echo "$APPLE_CERT_DEVELOPER_APPLICATION: OK" |
| 34 | +else |
| 35 | + echo "$APPLE_CERT_DEVELOPER_APPLICATION: FAILED" |
| 36 | + exit 1 |
| 37 | +fi |
18 | 38 |
|
19 | 39 | # Set the Keychain path where the certificates will be imported
|
20 | 40 | KEYCHAIN_PATH=$HOME/Library/Keychains/login.keychain-db
|
|
0 commit comments