Private Messaging
In DPSN, private messaging involves a two-step process:
Key Exchange: The publisher initially sends an encrypted key to the subscriber.
Message Encryption: Subsequent messages are encrypted using this shared key.
Integrating with the DPSN SDK
Publisher Side
Create a Private Message Channel: Use the
createPrivateChannel
function to generate a unique channel key.Publish the Public Key: Publish the public key to a designated topic.
Encrypt and Send Messages: Use the
publishPrivateMessage
function to encrypt and send messages to the specified channel.
Subscriber Side
Subscribe to the Topic: Subscribe to the topic where the public key was published.
Receive and Store Public Key: The SDK will automatically handle receiving and storing the public key.
Decrypt Messages: Use the
decryptPrivateMessage
function to decrypt incoming messages on the topic.
Key Features and Benefits
Simplified Integration: The SDK handles key generation, encryption, and decryption, making it easy to implement private messaging.
Security: DPSN ensures the security of private messages through robust encryption and key management.
Scalability: The system can handle a large number of private messages and subscribers.
Flexibility: Publishers can create multiple private channels and control access to them.
Last updated