Hi Mr Kurumi,
I am trying to decrypt the push notification frame
7ea06b8103109b10e6e700db08474f450000002960820052200000000b4bb6fce2d22f68b58a3de708de0a45b690d10bf2a2ac9a034fd3886fc6a5dc7cf8b67db461be5855dcb51dc32ba815c8692b41b4bad7a58bbaa45ab8f8e80526e0f610e34f50f090a2f6db5827cb647e
using the below code
String pushEventEncryptedHex="7ea06b8103109b10e6e700db08474f450000002960820052200000000b4bb6fce2d22f68b58a3de708de0a45b690d10bf2a2ac9a034fd3886fc6a5dc7cf8b67db461be5855dcb51dc32ba815c8692b41b4bad7a58bbaa45ab8f8e80526e0f610e34f50f090a2f6db5827cb647e";
GXDLMSSecureClient sc = new
GXDLMSSecureClient(true, 64, 1, Authentication.HIGH, null, InterfaceType.HDLC);
sc.getCiphering().setSecurity(Security.AUTHENTICATION_ENCRYPTION);
sc.getCiphering().setSystemTitle(GXCommon.hexToBytes("systemtitle"));
sc.setServerSystemTitle(GXCommon.hexToBytes("systemtitle"));
sc.getCiphering().setBlockCipherKey(GXCommon.hexToBytes("key"));
sc.getCiphering().setAuthenticationKey(GXCommon.hexToBytes("key"));
sc.getCiphering().setSecuritySuite(SecuritySuite.SUITE_0);
GXByteBuffer rd = new GXByteBuffer();
GXReplyData reply = new GXReplyData();
GXReplyData notify = new GXReplyData();
rd.set(Hex.decodeHex(pushEventEncryptedHex));
try {
boolean status = sc.getData(rd, reply, notify);
System.out.println(notify.getData().toHex(false,0));
System.out.println(reply.getData().toHex(false,0));
System.out.println(reply.getError());
System.out.println(gurux.common.GXCommon.bytesToHex(reply.getData().getData()));
if (reply.getError()!=0) {
throw new GXDLMSException(reply.getError());
}
} catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException |
InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException |
SignatureException e) {
throw new RuntimeException(e);
}
Getting the below Exception
INFO: Invalid HDLC Frame: 10 Expected: 30
Hi, Check push listener for…
Hi,
Check push listener for parsing push messages.
https://github.com/Gurux/gurux.dlms.java/tree/master/gurux.dlms.push.li…
You can also use GXDLMSTranslator to convert received push messages to XML string. You can find an example for this in the same project.
BR,
Mikko