Skip to content

Instantly share code, notes, and snippets.

@gschueler
Created September 6, 2022 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gschueler/3264609ee5bcd3eadf9c6316b348d6b0 to your computer and use it in GitHub Desktop.
Save gschueler/3264609ee5bcd3eadf9c6316b348d6b0 to your computer and use it in GitHub Desktop.
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