@averox/cryptosphare
Version:
Real-time SDK for end-to-end encrypted messaging, key monitoring, and secure A/V streaming
65 lines (64 loc) • 2.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AveroxCryptoSphere = void 0;
const KeyManager_1 = require("./crypto/KeyManager");
const Monitoring_1 = require("./crypto/Monitoring");
const config_1 = require("./config/config");
const logger_1 = require("./config/logger");
class AveroxCryptoSphere {
constructor(config = {}) {
this.logger = new logger_1.Logger({
minLevel: logger_1.LogLevel.INFO,
timestamps: true,
showLevel: true,
});
this.config = new config_1.Config({
environment: config.environment || 'development',
});
this.keyManager = new KeyManager_1.KeyManager();
this.keyManager.enableForwardSecrecy();
this.securityMonitor = new Monitoring_1.SecurityMonitor(config.telemetry || 'Basic');
this.setupEventListeners();
this.logger.info('AveroxCryptoSphere initialized successfully');
}
setupEventListeners() {
this.keyManager.onKeyGenerated((data) => {
this.securityMonitor.trackKeyEvent(data.type, {
type: 'generated',
status: 'active',
timestamp: data.timestamp,
metadata: {},
});
});
this.keyManager.onKeyRotated((data) => {
this.securityMonitor.trackKeyEvent(data.type, {
type: 'rotated',
status: 'active',
timestamp: data.timestamp,
metadata: {},
});
});
this.keyManager.onKeyCompromised((data) => {
this.securityMonitor.trackKeyEvent(data.type, {
type: 'compromised',
status: 'compromised',
timestamp: data.timestamp,
metadata: {},
});
});
}
getKeyManager() {
return this.keyManager;
}
getSecurityMonitor() {
return this.securityMonitor;
}
getConfig() {
return this.config;
}
enableQuantumResistance() {
this.keyManager.enableQuantumResistance();
this.logger.info('Quantum-resistant encryption enabled');
}
}
exports.AveroxCryptoSphere = AveroxCryptoSphere;