Peaceamakr Java Tools

These tools simplify integration with Peacemakr's Secure Data Platform, specifically the Peacemakr Java SDK.

License

License

Categories

Categories

Java Languages
GroupId

GroupId

io.peacemakr
ArtifactId

ArtifactId

peacemakr-java-tools
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Peaceamakr Java Tools
These tools simplify integration with Peacemakr's Secure Data Platform, specifically the Peacemakr Java SDK.
Project URL

Project URL

https://github.com/peacemakr-io/peacemakr-java-tools
Project Organization

Project Organization

io.peacemakr
Source Code Management

Source Code Management

https://github.com/peacemakr-io/peacemakr-java-tools/tree/master

Download peacemakr-java-tools

How to add to project

<!-- https://jarcasting.com/artifacts/io.peacemakr/peacemakr-java-tools/ -->
<dependency>
    <groupId>io.peacemakr</groupId>
    <artifactId>peacemakr-java-tools</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.peacemakr/peacemakr-java-tools/
implementation 'io.peacemakr:peacemakr-java-tools:0.0.1'
// https://jarcasting.com/artifacts/io.peacemakr/peacemakr-java-tools/
implementation ("io.peacemakr:peacemakr-java-tools:0.0.1")
'io.peacemakr:peacemakr-java-tools:jar:0.0.1'
<dependency org="io.peacemakr" name="peacemakr-java-tools" rev="0.0.1">
  <artifact name="peacemakr-java-tools" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.peacemakr', module='peacemakr-java-tools', version='0.0.1')
)
libraryDependencies += "io.peacemakr" % "peacemakr-java-tools" % "0.0.1"
[io.peacemakr/peacemakr-java-tools "0.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
io.peacemakr : peacemakr-java-sdk jar 0.0.2

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.



Build and Test

Peacemakr Java Tools

These tools simplify integration with Peacemakr's Secure Data Platform, specifically the Java SDK

Quick Start

Use the latest release of the Peacemakr Java SDK and the latest release of this package

<dependency>
    <groupId>io.peacemakr</groupId>
    <artifactId>peacemakr-java-sdk</artifactId>
    <version>0.0.2</version>
</dependency>
<dependency>
    <groupId>io.peacemakr</groupId>
    <artifactId>peacemakr-java-tools</artifactId>
    <version>0.0.1</version>
</dependency>

Then, you might do something like this in your code to define and encrypt some fields of a data class

import io.peacemakr.annotations.Encrypted;
import io.peacemakr.crypto.tools.Encryptor;
import io.peacemakr.crypto.Factory;
import io.peacemakr.crypto.ICrypto;
import io.peacemakr.crypto.impl.persister.InMemoryPersister;

private class Message {
    @Encrypted
    public String secretString;
    
    @Encrypted
    public byte[] secretBytes;
    
    public String publicString;
}

...
TestMessage msg = new TestMessage();
// ... fill message here
ICrypto p = Factory.getCryptoSDK("your API key", "your client name", null, new InMemoryPersister(), null);
Encryptor<TestMessage> encryptor = new Encryptor<>(TestMessage.class, p);

encryptor.encrypt(msg);

And maybe something like this to decrypt those fields

// ... receive encrypted message from outside
encryptor.decrypt(msg);

To see a more concrete example, please check out the tests.

Contributions

Peacemakr welcomes open and active contributions to this toolkit. As long as they're in the spirit of project, we will most likely accept them. However, you may want to get our opinion on proposed changes before investing time, so we can work together to solve problems you encounter in a way that makes sense for the future direction we have planned.

Testing

Without being a member of Peacemakr, you will not have full access to the testing infrastructure required for complete code coverage, but our CI build and test pipeline can be used to provide this level of visibility and feedback.

Releasing

Prerequisites:

  • Maven to be configured with Java8
  • Peacemakr GPG key

OSSRH:

  • add the following to ~/.m2/settings.xml; replace user_id and pass with proper values.
<settings>
  <servers>
    <server>
      <id>ossrh</id>
      <username>user_id</username>
      <password>pass</password>
    </server>
  </servers>
</settings>
  • release mvn clean deploy -P ossrh

Local repo:

  • release mvn clean install -P ossrh

If the following exception occurs during the release:

[INFO] --- maven-gpg-plugin:1.5:sign (sign-artifacts) @ crypto.tools ---
gpg: signing failed: Inappropriate ioctl for device

The following is the fix:

export GPG_TTY=$(tty) 
io.peacemakr

Peacemakr

Drop-in E2E-Encryption for every application

Versions

Version
0.0.1