Enzoic API - Developer Documentation
Visit our website
  • Enzoic Website
  • Getting Started
    • .NET Quick Start
    • Java Quick Start
    • JavaScript Quick Start
    • Ruby Quick Start
    • PHP Quick Start
    • Go Quick Start
    • Python Quick Start
  • Using the Enzoic API
  • Libraries
  • API reference
    • Passwords API
    • Credentials API
      • Hashed Credentials API
      • Cleartext Credentials API
        • Query Passwords for an Email Address
        • Query Passwords for a Domain
        • Query Passwords for a Partial Hash of an Email Address
      • Test Accounts
    • Exposures API
      • Get Exposures for an Email Address
      • Get Exposures for a Domain
      • Get Exposures for All Email Addresses in a Domain
      • Get Exposures by Date
      • Retrieve Details for an Exposure
    • Breach Monitoring API
      • Breach Monitoring by User
        • Add Breach Alert Subscriptions for Users
        • Remove Breach Alert Subscriptions for Users
        • Query Breach Alert Subscriptions for Users
      • Breach Monitoring by Domain
        • Add Breach Alert Subscriptions for Domains
        • Remove Breach Alert Subscriptions for Domains
        • Query Breach Alert Subscriptions for Domains
      • Webhooks
        • Managing Webhooks
          • Register a Webhook
          • Update a Webhook
          • Delete a Webhook
          • Query Registered Webhooks
        • Webhook Test API
    • Identity Breach Monitoring API
      • Monitoring Identities
        • Add Identities to Monitoring
        • Update Monitored Identities
        • Remove an Identity from Monitoring
        • Query Monitored Identities
      • Retrieving Identity Exposures
      • Webhooks
        • Managing Webhooks
          • Register a Webhook
          • Update a Webhook
          • Delete a Webhook
          • Query Registered Webhooks
        • Webhook Test API
    • BIN Monitoring API
      • Monitoring BINs
        • Add Bank Identification Numbers to Monitoring
        • Remove Bank Identification Numbers from Monitoring
        • Query Monitored Bank Identification Numbers
      • Retrieving Exposed Payment Cards
      • Webhooks
        • Managing Webhooks
          • Register a Webhook
          • Update a Webhook
          • Delete a Webhook
          • Query Registered Webhooks
        • Webhook Test API
    • Payment Card Exposures API
      • Check a Card Number for Compromise
    • Account Status APIs
      • Account Status
      • Account Usage
    • Password Hash Algorithms
    • OpenAPI Specification
    • View OpenAPI Spec in Swagger UI
    • Postman Collection of API Examples
  • Password Strength Meter
    • Quick Start
    • Example
Powered by GitBook
On this page
  • 1. Get an API Key and Secret
  • 2. Include the Enzoic Library in Your Project
  • 3. Try Out Our Example Code
  • 4. Learn More

Was this helpful?

  1. Getting Started

Java Quick Start

1. Get an API Key and Secret

If you haven’t already, sign up for a free trial.

2. Include the Enzoic Library in Your Project

The Java package is available either via package manager or direct download.

Maven

The enzoic-java-client is available in Maven Central. Just include the following in your pom.xml dependencies section.

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

Gradle

Include the following in your build.gradle dependencies section.

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

Download

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

3. Try Out Our Example Code

We’ve made calling the API dead simple. This sample code snippet shows you examples of calling the four supported APIs:

// 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("test@enzoic.com", "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("test@enzoic.com", "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("test@enzoic.com");
System.out.println(exposures.getCount() + " exposures found for test@enzoic.com");
 
// now get the full details for the first exposure found
ExposureDetails details = enzoic.GetExposureDetails(exposures.getExposures()[0]);
System.out.println("First exposure for test@enzoic.com was " + details.getTitle());

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

4. Learn More

That should get you started. Check out the GitHub project page for more details. Make sure you also review the Using the Enzoic API page.

Previous.NET Quick StartNextJavaScript Quick Start

Last updated 1 year ago

Was this helpful?