Source:
public MethodResultCode execute(final ClientConnection conn, final DlmsDevice device, final ProtocolMeterInfo protocolMeterInfo) throws ProtocolAdapterException { try { LOGGER.debug("SetEncryptionKeyExchangeOnGMeterCommandExecutor.execute called"); final byte[] decryptedEncryptionKey = RSAEncrypterService.decrypt( Hex.decode(protocolMeterInfo.getEncryptionKey()), this.privateKeyPath); final byte[] decryptedMasterKey = RSAEncrypterService.decrypt(Hex.decode(protocolMeterInfo.getMasterKey()), this.privateKeyPath); final ObisCode obisCode = OBIS_HASHMAP.get(protocolMeterInfo.getChannel()); final MethodParameter methodTransferKey = this.getTransferKeyToMBusMethodParameter(obisCode, decryptedMasterKey, decryptedEncryptionKey); List<MethodResult> methodResultCode = conn.action(methodTransferKey); this.checkMethodResultCode(methodResultCode, "getTransferKeyToMBusMethodParameter"); LOGGER.info("Success!: Finished calling getTransferKeyToMBusMethodParameter class_id obis_code {}", CLASS_ID, obisCode); final MethodParameter methodSetEncryptionKey = this.getSetEncryptionKeyMethodParameter(obisCode, decryptedEncryptionKey); methodResultCode = conn.action(methodSetEncryptionKey); this.checkMethodResultCode(methodResultCode, "getSetEncryptionKeyMethodParameter"); LOGGER.info("Success!: Finished calling setEncryptionKey class_id obis_code {}", CLASS_ID, obisCode); return MethodResultCode.SUCCESS; } catch (final IOException e) { LOGGER.error("Unexpected exception during decoding of data", e); throw new ConnectionException(e); } catch (final RsaEncrypterException e) { LOGGER.error("Unexpected exception during decryption of security keys", e); throw new ProtocolAdapterException("Unexpected exception during decryption of security keys, reason = " + e.getMessage()); } }

Target:
public MethodResultCode execute(final ClientConnection conn, final DlmsDevice device, final ProtocolMeterInfo protocolMeterInfo) throws ProtocolAdapterException { try { LOGGER.debug("SetEncryptionKeyExchangeOnGMeterCommandExecutor.execute called"); final byte[] decryptedEncryptionKey = RsaEncrypterService.decrypt( Hex.decode(protocolMeterInfo.getEncryptionKey()), this.privateKeyPath); final byte[] decryptedMasterKey = RsaEncrypterService.decrypt(Hex.decode(protocolMeterInfo.getMasterKey()), this.privateKeyPath); final ObisCode obisCode = OBIS_HASHMAP.get(protocolMeterInfo.getChannel()); final MethodParameter methodTransferKey = this.getTransferKeyToMBusMethodParameter(obisCode, decryptedMasterKey, decryptedEncryptionKey); List<MethodResult> methodResultCode = conn.action(methodTransferKey); this.checkMethodResultCode(methodResultCode, "getTransferKeyToMBusMethodParameter"); LOGGER.info("Success!: Finished calling getTransferKeyToMBusMethodParameter class_id obis_code {}", CLASS_ID, obisCode); final MethodParameter methodSetEncryptionKey = this.getSetEncryptionKeyMethodParameter(obisCode, decryptedEncryptionKey); methodResultCode = conn.action(methodSetEncryptionKey); this.checkMethodResultCode(methodResultCode, "getSetEncryptionKeyMethodParameter"); LOGGER.info("Success!: Finished calling setEncryptionKey class_id obis_code {}", CLASS_ID, obisCode); return MethodResultCode.SUCCESS; } catch (final IOException e) { LOGGER.error("Unexpected exception while connecting with device", e); throw new ConnectionException(e); } catch (final RsaEncrypterException e) { LOGGER.error("Unexpected exception during decryption of security keys", e); throw new ProtocolAdapterException("Unexpected exception during decryption of security keys, reason = " + e.getMessage()); } }