Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
List PBE providers for Jasypt with BouncyCastle and groovy
@Grab('org.jasypt:jasypt:1.9.3')
import org.jasypt.registry.AlgorithmRegistry
@Grab('org.bouncycastle:bcprov-jdk15on:1.70')
import org.bouncycastle.jce.provider.BouncyCastleProvider
import java.security.Security
Security.addProvider(new BouncyCastleProvider());
Set digestAlgos = AlgorithmRegistry.getAllDigestAlgorithms();
Set pbeAlgos = AlgorithmRegistry.getAllPBEAlgorithms();
System.out.println();
System.out.println("DIGEST ALGORITHMS: \n* " + digestAlgos.join("\n* "));
System.out.println();
System.out.println("PBE ALGORITHMS: \n* " + pbeAlgos.join("\n* "));
System.out.println();
//based on: https://github.com/jasypt/jasypt/blob/master/jasypt/src/main/java/org/jasypt/intf/cli/AlgorithmRegistryCLI.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment