public NetworkKey createNetworkKey() throws IllegalArgumentException {
        final NetworkKey key = new NetworkKey(getAvailableNetKeyIndex(), MeshParserUtils.toByteArray(SecureUtils.generateRandomNetworkKey()));
        key.setMeshUuid(meshUUID);
        return key;
    }
Creates an Network key

@return {@link NetworkKey}
@throws IllegalArgumentException in case the generated application key already exists
mesh/src/main/java/no/nordicsemi/android/mesh/BaseMeshNetwork.java