(key: Uint8Array)
| 215 | * Load the identity private key (decrypts identity.enc with the derived key). |
| 216 | */ |
| 217 | export function loadIdentityPrivateKey(key: Uint8Array): Uint8Array { |
| 218 | if (!existsSync(IDENTITY_PATH)) { |
| 219 | console.error("No identity found. Run `sharedcontext init` first."); |
| 220 | process.exit(1); |
| 221 | } |
| 222 | const encrypted = new Uint8Array(readFileSync(IDENTITY_PATH)); |
| 223 | return decrypt(encrypted, key); |
| 224 | } |
| 225 | |
| 226 | export function getSharedContextDir(): string { |
| 227 | return SHAREDCONTEXT_DIR; |
no test coverage detected