Changes following the hashCode of the deviceId being used as the certificate alias

This commit is contained in:
Shabirmean 2016-06-02 17:12:06 +05:30
parent fa454388ac
commit dca55d692c

View File

@ -25,7 +25,7 @@ public class VirtualFirealarmMqttContentTransformer implements ContentTransforme
Long serialNo = (Long) jsonPayload.get(VirtualFireAlarmConstants.JSON_SERIAL_KEY);
// the hash-code of the deviceId is used as the alias for device certificates during SCEP enrollment.
// hence, the same is used here to fetch the device-specific-certificate from the key store.
PublicKey clientPublicKey = VirtualFireAlarmUtils.getDevicePublicKey("" + serialNo);
PublicKey clientPublicKey = VirtualFireAlarmUtils.getDevicePublicKey("" + serialNo.hashCode());
// the MQTT-messages from VirtualFireAlarm devices are in the form {"Msg":<MESSAGE>, "Sig":<SIGNATURE>}
String actualMessage = VirtualFireAlarmUtils.extractMessageFromPayload((String) message, clientPublicKey);