derecalliance / api-java

DeRec API for use in applications.
Apache License 2.0
5 stars 0 forks source link

DeRecIdentity: Add `publicEncryptionKeyId` to the class #31

Closed diptimahamuni closed 1 month ago

diptimahamuni commented 1 month ago

Problem

During contact, the Sharer learns the publicEncryptionKey and publicEncryptionKeyId of the Helper. From the information in the QR code, the Sharer creates a DeRecIdentity helperId and uses that helperId as a parameter to the addHelpers() API. Currently, the DeRecIdentity only stores the publicEncryptionKey, but not the publicEncryptionKeyId, which the library needs to use for prepending any subsequent message.

It makes the most sense to store this publicEncryptionKeyId along with the publicEncryptionKey (see issue #29) in the DeRecIdentity after establishing contact.

Solution

Add private int publicEncryptionKeyId as a class variable to DeRecIdentity.java. The constructor and getters were changed to accommodate the addition of publicEncryptionKeyId in the DeRecIdentity class.