forked from iosdevzone/IDZSwiftCommonCrypto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
import_certs.bash
executable file
·29 lines (22 loc) · 1005 Bytes
/
import_certs.bash
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
#!/bin/bash
KEYCHAIN=IDZSwiftCommonCrypto.keychain
SCRIPT_DIR=.
# If this environment variable is missing, we must not be running on Travis.
if [ -z "$KEY_PASSWORD" ]
then
return 0
fi
echo "*** Setting up code signing $KEYCHAIN ..."
password=cibuild
# Create a temporary keychain for code signing.
security create-keychain -p "$password" "$KEYCHAIN"
security default-keychain -s "$KEYCHAIN"
security unlock-keychain -p "$password" "$KEYCHAIN"
security set-keychain-settings -t 3600 -l "$KEYCHAIN"
# Download the certificate for the Apple Worldwide Developer Relations
# Certificate Authority.
certpath="$SCRIPT_DIR/apple_wwdr.cer"
curl 'https://developer.apple.com/certificationauthority/AppleWWDRCA.cer' > "$certpath"
security import "$certpath" -k "$KEYCHAIN" -T /usr/bin/codesign
# Import our development certificate.
security import "./developer.p12" -k "$KEYCHAIN" -P "$KEY_PASSWORD" -T /usr/bin/codesign