11# CertCheck
2- Node JS utility to check the signature of Apple P12 Certificates.
2+ Modern TypeScript utility to check the signature of Apple P12 Certificates using idiomatic TypeScript and modern APIs .
33
44* Confirmed to work on macOS, Windows, and Linux.*
55
6- * Works with both enterprise and developer certificates.*
7-
8- Includes tool to convert CER files to PEM. (See [ ** cer-to-pem.js** ] ( https://github.com/JailbreaksApp/CertCheck/blob/master/cer-to-pem.js ) )
6+ * Works with enterprise, developer, and distribution certificates.*
97
108## Contact
119 - [ ** Twitter** ** (@iCrazeiOS )** ] ( https://twitter.com/iCrazeiOS )
@@ -16,16 +14,141 @@ Includes tool to convert CER files to PEM. (See [**cer-to-pem.js**](https://gith
1614 - ** BTC:** bc1q0ghuykcutljjyh3tcdjv88ek8zjzrtnk8zhuhy
1715
1816## Requirements
19- - Node JS (with ` ocsp ` & ` node-forge ` modules)
17+ - [ Bun] ( https://bun.sh ) (v1.0.0 or higher)
18+ - TypeScript (for development)
19+
20+ ## Installation
21+ ``` bash
22+ # Install Bun (if not already installed)
23+ curl -fsSL https://bun.sh/install | bash
24+
25+ # Install dependencies (only if you want to develop, otherwise see the bunx command below)
26+ bun install
27+ ```
2028
2129## Usage
22- ** Standard usage:**
23- - Have cert.p12 and pass.txt in the same directory as the script.
24- - Run ` node index.js `
2530
26- ** Specify directory:**
27- - Have cert.p12 and pass.txt in a different directory than the script.
28- - Run ` node index.js "/path/to/directory" `
31+ ## Give me quick copy-paste command I’m impatient
32+
33+ ``` bash
34+ bunx github:Olympta/CertCheck certcheck cert.p12 --password 123456
35+ ```
36+
37+ No need to clone the repo.
38+
39+ ### Using Package Scripts (Recommended)
40+ ``` bash
41+ # Main certificate checker
42+ bun certcheck cert.p12 --password yourpassword
43+
44+ # With JSON output
45+ bun certcheck cert.p12 --password yourpassword --json
46+
47+ # Short password flag
48+ bun certcheck cert.p12 -p yourpassword
49+
50+ # Download Apple CA certificates (run this first)
51+ bun ca-downloader
52+ ```
53+
54+ ### Direct Bun Execution
55+ ``` bash
56+ # Basic usage with P12 file and password
57+ bun certcheck cert.p12 --password yourpassword
58+
59+ # With JSON output
60+ bun certcheck cert.p12 --password yourpassword --json
61+
62+ # Short password flag
63+ bun certcheck cert.p12 -p yourpassword
64+
65+ # Absolute paths work too
66+ bun certcheck /path/to/cert.p12 --password yourpassword
67+ ```
68+
69+ ### Environment Variables
70+ ``` bash
71+ # Set environment variables
72+ export CERT_P12_PATH=cert.p12
73+ export CERT_P12_PASSWORD=yourpassword
74+
75+ # Run without arguments
76+ bun certcheck
77+
78+ # JSON output still works
79+ bun certcheck --json
80+ ```
81+
82+ ### Mixed Usage (CLI overrides environment variables)
83+ ``` bash
84+ # Environment variables as fallback
85+ CERT_P12_PATH=cert.p12 bun certcheck --password yourpassword
86+ CERT_P12_PASSWORD=yourpassword bun certcheck cert.p12
87+
88+ # CLI arguments always take priority
89+ CERT_P12_PATH=wrong.p12 CERT_P12_PASSWORD=wrongpass bun certcheck cert.p12 --password yourpassword
90+ ```
91+
92+ ### Download Apple CA Certificates
93+ ``` bash
94+ # Download and convert Apple CA certificates (run this first)
95+ bun ca-downloader
96+ ```
97+
98+ ## File Structure
99+ ```
100+ src/
101+ ├── index.ts # OCSP certificate revoke checker
102+ ├── caDownloader.ts # Apple CA certificates downloader
103+ ├── p12Utils.ts # P12 to PEM conversion utilities
104+ ├── cerUtils.ts # CER to PEM converter class
105+ └── types/
106+ └── ocsp.d.ts # OCSP module type definitions
107+ ```
108+
109+ ## Development
110+ ``` bash
111+ # Install dependencies
112+ bun install
113+
114+ # Type check
115+ bun type-check
116+
117+ # Run main application
118+ bun certcheck cert.p12 --password yourpassword
119+
120+ # Download Apple CA certificates
121+ bun ca-downloader
122+
123+ # Development mode
124+ bun dev cert.p12 --password yourpassword
125+ bun dev:ca-downloader
126+ ```
127+
128+ ## Example Output
129+
130+ ### Good Certificate
131+ ``` bash
132+ $ bun certcheck cert.p12 --password 123456
133+ Certificate Name: John Doe
134+ Certificate Status: good
135+ Certificate Expiration Date: Sat, 22 Aug 2026 18:21:48 GMT
136+ ```
137+
138+ ### Revoked Certificate
139+ ``` bash
140+ $ bun certcheck revoked.p12 --password 123456
141+ Certificate Name: Jane Smith
142+ Certificate Status: revoked
143+ Certificate Expiration Date: Thu, 23 Jul 2026 00:06:58 GMT
144+ Certificate Revocation Date: Mon, 25 Aug 2025 18:37:02 GMT
145+ ```
146+
147+ ### JSON Output
148+ ``` bash
149+ $ bun certcheck cert.p12 --password 123456 --json
150+ {" name" :" John Doe" ," expirationDate" :" Sat, 22 Aug 2026 18:21:48 GMT" ," status" :" good" }
151+ ```
29152
30- ** JSON output: **
31- - Follow steps for other examples, but add ` --json ` to the end of the command. (MUST be after custom directory, if you are using one)
153+ ## License
154+ MIT
0 commit comments