public ApplicationKey createAppKey() throws IllegalArgumentException {
        if (netKeys.isEmpty()) {
            throw new IllegalStateException("Cannot create an App Key without a Network key. Consider creating a network key first");
        }

        final ApplicationKey key = new ApplicationKey(getAvailableAppKeyIndex(), MeshParserUtils.toByteArray(SecureUtils.generateRandomApplicationKey()));
        key.setMeshUuid(meshUUID);
        return key;
    }
Creates an application key

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