class TPM2ProvisionerState {

    public static TPM2ProvisionerState getTPM2ProvisionerState(
            final CrudManager<TPM2ProvisionerState> crudManager,
            final byte[] nonce) {
        try (DataInputStream dis
                     = new DataInputStream(new ByteArrayInputStream(nonce))) {
            long firstPartOfNonce = dis.readLong();
            TPM2ProvisionerState stateFound = crudManager.get(firstPartOfNonce);
            if (Arrays.areEqual(stateFound.getNonce(), nonce)) {
                return stateFound;
            }
        } catch (IOException | NullPointerException e) {
            return null;
        }
        return null;
    }

    protected  TPM2ProvisionerState();
    public  TPM2ProvisionerState(final byte[] nonce, final byte[] identityClaim);

}