Skip to content

Commit 3575fcc

Browse files
committed
feat: add certificate verification and re-export scripts
- Add verify-certificate.sh to test certificate password - Add export-certificate-simple.sh for manual export method - Help troubleshoot certificate password issues
1 parent 060ece4 commit 3575fcc

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed

scripts/export-certificate-simple.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
3+
# Simplified certificate export script
4+
echo "Simple Certificate Export for GitHub Actions"
5+
echo "==========================================="
6+
echo ""
7+
echo "This script will export your Developer ID Application certificate."
8+
echo ""
9+
10+
# List certificates
11+
echo "Available Developer ID certificates:"
12+
echo "-----------------------------------"
13+
security find-identity -v -p codesigning | grep "Developer ID Application"
14+
15+
echo ""
16+
echo "Please follow these steps:"
17+
echo ""
18+
echo "1. Open Keychain Access"
19+
echo "2. Find your 'Developer ID Application' certificate"
20+
echo "3. Right-click and select 'Export...'"
21+
echo "4. Save as a .p12 file with a simple password (no special characters)"
22+
echo "5. Note the exact password you used"
23+
echo ""
24+
read -p "Press Enter after you've exported the certificate..."
25+
26+
echo ""
27+
read -p "Enter the path to your exported .p12 file: " P12_PATH
28+
29+
if [ ! -f "$P12_PATH" ]; then
30+
echo "❌ File not found: $P12_PATH"
31+
exit 1
32+
fi
33+
34+
echo ""
35+
echo "Converting to base64..."
36+
CERT_BASE64=$(base64 < "$P12_PATH")
37+
38+
echo ""
39+
echo "Certificate prepared!"
40+
echo ""
41+
echo "Now update these GitHub secrets:"
42+
echo "================================"
43+
echo ""
44+
echo "1. Go to: https://github.com/vijaythecoder/clueless/settings/secrets/actions"
45+
echo ""
46+
echo "2. Update NATIVEPHP_CERTIFICATE_BASE64 with the base64 string"
47+
echo " (It has been copied to your clipboard)"
48+
echo ""
49+
echo "3. Update NATIVEPHP_CERTIFICATE_PASSWORD with your password"
50+
echo " ⚠️ Make sure to enter the exact password with no extra spaces"
51+
echo ""
52+
53+
if command -v pbcopy &> /dev/null; then
54+
echo "$CERT_BASE64" | pbcopy
55+
echo "✅ Base64 certificate copied to clipboard!"
56+
else
57+
echo "Base64 certificate:"
58+
echo "=================="
59+
echo "$CERT_BASE64"
60+
echo "=================="
61+
fi
62+
63+
echo ""
64+
echo "After updating both secrets, push any change to trigger a new build."

scripts/verify-certificate.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
# Script to verify certificate and password
4+
echo "Certificate Verification Tool"
5+
echo "============================"
6+
echo ""
7+
echo "This will help verify your certificate export and password."
8+
echo ""
9+
10+
read -p "Enter the path to your .p12 file: " P12_PATH
11+
read -p "Enter the password for the .p12 file: " -s P12_PASSWORD
12+
echo ""
13+
14+
echo ""
15+
echo "Verifying certificate..."
16+
17+
# Check if file exists
18+
if [ ! -f "$P12_PATH" ]; then
19+
echo "❌ File not found: $P12_PATH"
20+
exit 1
21+
fi
22+
23+
# Try to read certificate info
24+
echo "Testing password..."
25+
if security cms -D -i "$P12_PATH" -k "$P12_PASSWORD" 2>/dev/null; then
26+
echo "✅ Password is correct!"
27+
else
28+
echo "❌ Password verification failed. Please check your password."
29+
echo ""
30+
echo "Common issues:"
31+
echo "1. Wrong password"
32+
echo "2. Special characters in password need escaping"
33+
echo "3. Certificate was exported with a different password"
34+
exit 1
35+
fi
36+
37+
echo ""
38+
echo "Extracting certificate information..."
39+
openssl pkcs12 -in "$P12_PATH" -passin pass:"$P12_PASSWORD" -noout -info 2>&1 | grep -v "MAC verified OK"
40+
41+
echo ""
42+
echo "Certificate details:"
43+
security cms -D -i "$P12_PATH" -k "$P12_PASSWORD" | openssl x509 -noout -subject -issuer -dates
44+
45+
echo ""
46+
echo "✅ Certificate verified successfully!"
47+
echo ""
48+
echo "Converting to base64..."
49+
CERT_BASE64=$(base64 < "$P12_PATH")
50+
51+
echo ""
52+
echo "Base64 length: ${#CERT_BASE64} characters"
53+
echo ""
54+
echo "If you need to update the GitHub secret, the base64 string has been copied to clipboard."
55+
56+
if command -v pbcopy &> /dev/null; then
57+
echo "$CERT_BASE64" | pbcopy
58+
echo "✅ Base64 certificate copied to clipboard!"
59+
fi

0 commit comments

Comments
 (0)