public NetworkKey getNetKey(final int keyIndex) {
        for (NetworkKey key : netKeys) {
            if (keyIndex == key.getKeyIndex()) {
                try {
                    return key.clone();
                } catch (CloneNotSupportedException e) {
                    MeshLogger.error(TAG, "Error while cloning key: " + e.getMessage());
                }
            }
        }
        return null;
    }
Returns a network key with a given key index.

@param keyIndex index
mesh/src/main/java/no/nordicsemi/android/mesh/BaseMeshNetwork.java