onetime-java

Created: 2014-05-19 02:47
Updated: 2014-06-14 22:29
License: mit

README.md

#onetime-java Build Status

Java implementation of the https://github.com/onetimesecret/onetimesecret REST api.

###Usage Example

Add a maven dependency to the onetime-java-rest artifact.

<dependency>
    <groupId>com.onetimesecret</groupId>
    <artifactId>onetime-java-rest</artifactId>
    <version>1.0</version>
</dependency>

Then use it to generate and retrieve secrets to your liking.

OneTimeSecret ots = new OneTimeSecretRestImpl(
    "https://path/to/ots/instance",
    "ots-username",
    "ots-apikey");

GenerateResponse generateResponse = ots.generate(
                new GenerateRequest.Builder()
                        .withPassphrase("supersecret")
                        .build());
                
RetrieveResponse retrieveResponse = ots.retrieve(
                new RetrieveRequest.Builder()
                        .withSecretKey(generateResponse.getSecretKey())
                        .withPassphrase("supersecret")
                        .build());
                        
assertEquals(generateResponse.getValue(), retrieveResponse.getValue());
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more