private byte[] createProvisioningDataPDU() {

        final byte[] provisioningSalt = generateProvisioningSalt();
        MeshLogger.verbose(TAG, "Provisioning salt: " + MeshParserUtils.bytesToHex(provisioningSalt, false));

        final byte[] ecdh = mUnprovisionedMeshNode.getSharedECDHSecret();

        final byte[] t = SecureUtils.calculateCMAC(ecdh, provisioningSalt);
        /* Calculating the session key */
        final byte[] sessionKey = SecureUtils.calculateCMAC(SecureUtils.PRSK, t);
        MeshLogger.verbose(TAG, "Session key: " + MeshParserUtils.bytesToHex(sessionKey, false));

        /* Calculate the Session nonce */
        final byte[] sessionNonce = generateSessionNonce(ecdh, provisioningSalt);
        MeshLogger.verbose(TAG, "Session nonce: " + MeshParserUtils.bytesToHex(sessionNonce, false));

        /* Calculate the Device key */
        final byte[] deviceKey = SecureUtils.calculateCMAC(SecureUtils.PRDK, t);
        MeshLogger.verbose(TAG, "Device key: " + MeshParserUtils.bytesToHex(deviceKey, false));
        mUnprovisionedMeshNode.setDeviceKey(deviceKey);

        /* Generate 16 byte Random network key */
        final byte[] networkKey = mUnprovisionedMeshNode.getNetworkKey();
        MeshLogger.verbose(TAG, "Network key: " + MeshParserUtils.bytesToHex(networkKey, false));

        /* Generate random 2 byte Key index*/
        final byte[] keyIndex = MeshParserUtils.addKeyIndexPadding(mUnprovisionedMeshNode.getKeyIndex());
        MeshLogger.verbose(TAG, "Key index: " + MeshParserUtils.bytesToHex(keyIndex, false));

        /* Generate random 1 byte Flags */
        byte[] flags = mUnprovisionedMeshNode.getFlags();
        MeshLogger.verbose(TAG, "Flags: " + MeshParserUtils.bytesToHex(flags, false));

        /* Generate random 4 byte IV Index */
        final byte[] ivIndex = mUnprovisionedMeshNode.getIvIndex();
        MeshLogger.verbose(TAG, "IV index: " + MeshParserUtils.bytesToHex(ivIndex, false));

        /* Generate random 2 byte unicast address*/
        final byte[] unicastAddress = MeshAddress.addressIntToBytes(mUnprovisionedMeshNode.getUnicastAddress());

        MeshLogger.verbose(TAG, "Unicast address: " + MeshParserUtils.bytesToHex(unicastAddress, false));
        ByteBuffer buffer = ByteBuffer.allocate(networkKey.length + keyIndex.length + flags.length + ivIndex.length + unicastAddress.length);
        buffer.put(networkKey);
        buffer.put(keyIndex);
        buffer.put(flags);
        buffer.put(ivIndex);
        buffer.put(unicastAddress);

        final byte[] provisioningData = buffer.array();
        MeshLogger.verbose(TAG, "Provisioning data: " + MeshParserUtils.bytesToHex(provisioningData, false));

        final byte[] encryptedProvisioningData = SecureUtils.encryptCCM(provisioningData, sessionKey, sessionNonce, 8);
        if (encryptedProvisioningData == null)
            throw new IllegalArgumentException("Failed to encrypt provisioning data!");
        buffer = ByteBuffer.allocate(2 + encryptedProvisioningData.length);
        MeshLogger.verbose(TAG, "Encrypted provisioning data: " + MeshParserUtils.bytesToHex(encryptedProvisioningData, false));
        buffer.put(MeshManagerApi.PDU_TYPE_PROVISIONING);
        buffer.put(TYPE_PROVISIONING_DATA);
        buffer.put(encryptedProvisioningData);

        final byte[] provisioningPDU = buffer.array();
        MeshLogger.verbose(TAG, "Prov Data: " + MeshParserUtils.bytesToHex(provisioningPDU, false));
        return provisioningPDU;
    }
Constructs the provisioning data state.

@param node                            {@link UnprovisionedMeshNode} node.
@param callbacks                       {@link InternalProvisioningCallbacks} callbacks.
@param internalTransportCallbacks      {@link InternalTransportCallbacks} callbacks.
@param meshProvisioningStatusCallbacks {@link MeshProvisioningStatusCallbacks} callbacks.
mesh/src/main/java/no/nordicsemi/android/mesh/provisionerstates/ProvisioningDataState.java