Skip to content

Getting Started

Getting Started

Overview

To use mango4j-crypto, add the dependency to your project, then (from the next stage on) annotate the entity fields you want encrypted. This stage doesn't do anything on its own — it's just the starting point: a bare Maven project with the dependency already wired up, so everyone begins from the same place before we start adding the annotations that actually do the work.

Follow along

git clone https://github.com/bitstep-ie/mango4j-crypto-workshop.git
cd mango4j-crypto-workshop/stages/01-Getting-Started
Using an IDE instead? Just clone the repository, then open stages/01-Getting-Started as its own project.

The dependency

stages/01-Getting-Started/pom.xml already has mango4j-crypto declared:

<dependency>
    <groupId>ie.bitstep.mango</groupId>
    <artifactId>mango4j-crypto</artifactId>
    <version>1.0.0</version>
</dependency>

That's it — this project can now use the @Encrypt, @Hmac, @EncryptedData, @EncryptionKeyId and @HmacKeyId annotations that mango4j-crypto provides.

Feel free to experiment here — each stage is its own standalone folder, so nothing you change in 01-Getting-Started affects 02-Encrypt-a-Field. When you're ready, just move on:

cd ../02-Encrypt-a-Field