encryption/MessageEncryptionService Service
File: src/services/encryption/MessageEncryptionService.ts
Overview
Exports
- EncryptionStatus - interface export
- EncryptedMessageData - interface export
- MessageEncryptionService - class export
- messageEncryptionService - const export
Classes
MessageEncryptionService
No description available.
Methods:
constructorgetInstanceinitializecatchusergetCurrentUserIdhasEncryptionKeyssetupEncryptiongeneratePrekeysencryptMessagehasEncryptionKeyLoadedunlockEncryptionneedsUnlockdecryptMessageencryptGroupMessagedecryptGroupMessageestablishSessioncheckServerEncryptionPolicycheckConversationEncryptionenableConversationEncryptionisEncryptedContentgetEncryptionStatusrotatePrekeysarrayBufferToBase64base64ToArrayBufferexportBackupimportBackuphasStoredKeysresetEncryptioncleanup
Properties:
instancekeyStorecurrentUserIdinitializedINITIALIZATIONuserkeypasswordauth_user_iddataencryptionfounduserIdIDfirstrestoredprovidedServicetrueupfalsesupabasep_user_idkeysSETUPpairidentityKeyPairregistrationIddatabasep_identity_public_keyp_identity_private_key_encryptedp_device_idstorestoragekeyPairpubKeyprivKeyprekeysserverconflictsfailuressignedPreKeyKey1decryptionidpreKeysupsertIMPORTANTerroruser_iddevice_idprekey_id_keyis_signedis_one_timesignatureonConflictprekeyprekeyData50ibatchcontentmetadatarecipientIdsselfhasOtherRecipientssymmetricKeyiv2plaintextContentencoderplaintextBuffercryptoKeynameencryptedBufferencryptedBase64ivBase643encryptedKeyssymmetricKeyBase64casetypecontinuerecipientAddresshasSessionsessionencryptedKeyrecipientotherstextencryptedContentencryptedencryption_metadataalgorithmencrypted_forsender_key_idtimestampencrypted_keysIndexedDBidentityKeyloadedProtocolmessagesenderIdencryptedKeyDatasenderAddressaddressuserserrorMsgmessagessessionErrordecryptedBufferdecoderdecryptedJsondecryptedContentfailedgroupIddecryptMessageMANAGEMENTbundlelibrarytransformedBundledeviceIdoneTimePreKeyundefinedCHECKINGp_server_idpolicyenabledhasKeysneedsSetupmodeisEncryptedp_conversation_idencryptionEnabledconversationUTILITIESdisplayavailablekeyCountcountrotatedremainingMETHODSbytesbinarypresentnormalizedBase64stringRECOVERYfilebackupbackupPasswordENCRYPTIONfreshdeletednullstateCLEANUP
Interfaces
EncryptionStatus
No description available.
typescript
interface EncryptionStatus {
enabled: boolean
hasKeys: boolean
needsSetup: boolean
mode: 'disabled' | 'optional' | 'required' | 'required_local_only'
}1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
EncryptedMessageData
No description available.
typescript
interface EncryptedMessageData {
encrypted: true
content: MessagePart[] // Encrypted content (base64 ciphertext in text field)
encryption_metadata: {
algorithm: 'signal_protocol_v1_hybrid' // Hybrid: AES-GCM + Signal Protocol
encrypted_for: string[] // User IDs this message is encrypted for
sender_key_id: string
timestamp: number
encrypted_keys: Record<string, string> // Map of user_id -> encrypted symmetric key
iv: string // Initialization vector for AES-GCM
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Source Code Insights
File Size: 30311 characters Lines of Code: 941 Imports: 5
Usage Example
typescript
import { EncryptionStatus, EncryptedMessageData, MessageEncryptionService, messageEncryptionService } from '@/services/encryption/MessageEncryptionService'
// Example usage
// Use the exported functionality1
2
3
4
2
3
4
This documentation was automatically generated from the source code.
