forked from connect-boiz/stellar-privacy-analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify-key-management.sh
More file actions
executable file
·100 lines (88 loc) · 3.04 KB
/
Copy pathverify-key-management.sh
File metadata and controls
executable file
·100 lines (88 loc) · 3.04 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
echo "🔍 Verifying Cryptographic Key Management Service Implementation"
echo "=================================================================="
echo ""
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Counters
PASSED=0
FAILED=0
# Function to check file exists
check_file() {
if [ -f "$1" ]; then
echo -e "${GREEN}✓${NC} $1"
((PASSED++))
else
echo -e "${RED}✗${NC} $1 (MISSING)"
((FAILED++))
fi
}
# Function to check directory exists
check_dir() {
if [ -d "$1" ]; then
echo -e "${GREEN}✓${NC} $1"
((PASSED++))
else
echo -e "${RED}✗${NC} $1 (MISSING)"
((FAILED++))
fi
}
echo "📁 Checking Core Services..."
check_file "backend/src/services/keyManagement/KeyManagementService.ts"
check_file "backend/src/services/keyManagement/ThresholdCryptography.ts"
check_file "backend/src/services/keyManagement/KeyRotationScheduler.ts"
check_file "backend/src/services/keyManagement/KeyBackupService.ts"
check_file "backend/src/services/keyManagement/KeySharingService.ts"
check_file "backend/src/services/keyManagement/PerformanceOptimizer.ts"
check_file "backend/src/services/keyManagement/SMPCKeyIntegration.ts"
check_file "backend/src/services/keyManagement/ZKPKeyIntegration.ts"
check_file "backend/src/services/keyManagement/index.ts"
echo ""
echo "🌐 Checking API Routes..."
check_file "backend/src/routes/keyManagement.ts"
echo ""
echo "📚 Checking Documentation..."
check_file "backend/docs/KEY_MANAGEMENT_SERVICE.md"
check_file "backend/docs/KEY_MANAGEMENT_SECURITY_AUDIT.md"
check_file "KEY_MANAGEMENT_IMPLEMENTATION.md"
check_file "KEY_MANAGEMENT_SUMMARY.md"
check_file "QUICK_START_KEY_MANAGEMENT.md"
echo ""
echo "🔧 Checking Existing HSM Integration..."
check_file "backend/src/services/hsmService.ts"
check_file "backend/src/services/masterKeyManager.ts"
check_file "backend/src/services/hsmIntegration.ts"
check_file "backend/src/config/hsmConfig.ts"
check_file "backend/src/routes/hsm.ts"
echo ""
echo "📦 Checking Dependencies..."
if grep -q "lru-cache" backend/package.json; then
echo -e "${GREEN}✓${NC} lru-cache dependency found"
((PASSED++))
else
echo -e "${RED}✗${NC} lru-cache dependency missing"
((FAILED++))
fi
echo ""
echo "=================================================================="
echo "📊 Verification Results"
echo "=================================================================="
echo -e "Passed: ${GREEN}${PASSED}${NC}"
echo -e "Failed: ${RED}${FAILED}${NC}"
echo ""
if [ $FAILED -eq 0 ]; then
echo -e "${GREEN}✅ All checks passed! Implementation is complete.${NC}"
echo ""
echo "Next steps:"
echo "1. Configure HSM: cp backend/.env.hsm.example backend/.env"
echo "2. Run tests: npm test -- --testPathPattern=keyManagement"
echo "3. Start service: npm run dev"
echo "4. Check health: curl http://localhost:3000/api/v1/key-management/health"
exit 0
else
echo -e "${RED}❌ Some checks failed. Please review the missing files.${NC}"
exit 1
fi