public class SendMessageToParticleGroupsMapper extends java.lang.Object implements StatelessActionToParticleGroupsMapper<SendMessageAction>
| Constructor and Description |
|---|
SendMessageToParticleGroupsMapper(java.util.function.Supplier<ECKeyPair> keyPairGenerator)
New SendMessage action mapper which by default adds both sender and receiver
public keys as readers of encrypted messages
|
SendMessageToParticleGroupsMapper(java.util.function.Supplier<ECKeyPair> keyPairGenerator,
java.util.function.Function<SendMessageAction,java.util.stream.Stream<ECPublicKey>> encryptionScheme)
SendMessage action mapper which uses a given eckeypair generator and encryption
scheme
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<ParticleGroup> |
mapToParticleGroups(SendMessageAction action)
If SendMessageAction is unencrypted, returns a single message particle containing the
payload data.
|
public SendMessageToParticleGroupsMapper(java.util.function.Supplier<ECKeyPair> keyPairGenerator)
keyPairGenerator - module to be used for creating new securely random ECKeyPairspublic SendMessageToParticleGroupsMapper(java.util.function.Supplier<ECKeyPair> keyPairGenerator, java.util.function.Function<SendMessageAction,java.util.stream.Stream<ECPublicKey>> encryptionScheme)
keyPairGenerator - module to be used for creating new securely random ECKeyPairsencryptionScheme - function to decide which public keys to encrypt wihtpublic java.util.List<ParticleGroup> mapToParticleGroups(SendMessageAction action)
If SendMessageAction is encrypted, creates a private key encrypted by both from and to users, stores that into a message particles and then creates another message particle with the payload encrypted by the newly created private key.
mapToParticleGroups in interface StatelessActionToParticleGroupsMapper<SendMessageAction>action - the action to mapToParticles to particles