Git Product home page Git Product logo

enzoic-java-client's Introduction

Enzoic Java Client Library

Build Status

TOC

This README covers the following topics:

Installation

The compiled library is available in two ways:

Maven

The enzoic-java-client is available in Maven Central.

<dependencies>
    <dependency>
      <groupId>com.enzoic</groupId>
      <artifactId>enzoic-java-client</artifactId>
      <version>3.7.0</version>
    </dependency>
</dependencies>

Gradle

dependencies {
  compile 'com.enzoic:enzoic-java-client:3.7.0'
}

Download

You can download a version of the .jar directly from https://oss.sonatype.org/content/groups/public/com/enzoic/enzoic-java-client/

Source

You can build the project from the source in this repository.

API Overview

Here's the API in a nutshell.

// Create a new Enzoic instance - this is our primary interface for making API calls
Enzoic enzoic = new Enzoic(YOUR_API_KEY, YOUR_API_SECRET);

// (Optional) Set a reasonable timeout for our application, in milliseconds.
enzoic.SetRequestTimeout(500);

// Check whether a password has been compromised
if (enzoic.CheckPassword("password-to-test")) {
    System.out.println("Password is compromised");
}
else {
    System.out.println("Password is not compromised");
}

// Check whether a password has been compromised with extended return information
CheckPasswordExResponse response = enzoic.CheckPasswordEx("password-to-test");
if (response != null) {
    System.out.println("Password is compromised");
    if (response.isRevealedInExposure()) {
        System.out.println("Password has been revealed in a data breach " +
            Integer.toString(response.exposureCount()) +  
            " times and has a relative breach frequency of " +
            Integer.toString(response.relativeExposureFrequency()));
    }
    else {
        System.out.println("Password has not been revealed in a data breach, but exists publicly in cracking dictionaies.");
    }
}
else {
    System.out.println("Password is not compromised");
}

 
// Check whether a specific set of credentials are compromised
if (enzoic.CheckCredentials("[email protected]", "password-to-test")) {
    System.out.println("Credentials are compromised");
}
else {
    System.out.println("Credentials are not compromised");
}

// Use the CheckCredentialsEx call to tweak performance by including the
// date/time of the last check and excluding BCrypt
if (enzoic.CheckCredentialsEx("[email protected]", "password-to-test",
        lastCheckTimestamp, new PasswordType[] { PasswordType.BCrypt })) {
    System.out.println("Credentials are compromised");
}
else {
    System.out.println("Credentials are not compromised");
}
 
// get all exposures for a given user
ExposuresResponse exposures = enzoic.GetExposuresForUser("[email protected]");
System.out.println(exposures.getCount() + " exposures found for [email protected]");
 
// now get the full details for the first exposure found
ExposureDetails details = enzoic.GetExposureDetails(exposures.getExposures()[0]);
System.out.println("First exposure for [email protected] was " + details.getTitle());

// get all passwords for a given user - requires special approval, contact Enzoic sales
UserPasswords userPasswords = enzoic.GetUserPasswords("[email protected]");
System.out.println("First password for [email protected] was " + userPasswords.getPasswords[0].getPassword());

More information in reference format can be found below.

The Enzoic constructor

The standard constructor takes the API key and secret you were issued on Enzoic signup.

Enzoic enzoic = new Enzoic(YOUR_API_KEY, YOUR_API_SECRET);

If you were instructed to use an alternate API endpoint, you may call the overloaded constructor and pass the base URL you were provided.

Enzoic enzoic = new Enzoic(YOUR_API_KEY, YOUR_API_SECRET, "https://api-alt.enzoic.com/v1");

JavaDocs

The JavaDocs contain more complete references for the API functions.

They can be found here: http://javadoc.io/doc/com.enzoic/enzoic-java-client/

enzoic-java-client's People

Contributors

mwilson71 avatar

Stargazers

Steve Leve avatar  avatar  avatar

Watchers

Gregg Ganley avatar James Cloos avatar  avatar  avatar

Forkers

mallaaditya

enzoic-java-client's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.