Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
Ho do I run the Bouncy castle algorithm from Mirth Connect?

I have good examples on how to call the Bouncy Castle algorithm from Java. But I am new to Mirth and JavaScript. Please help me to translate the below java program to JavaScript?

Source: https://forums.mirthproject.io/forum...ncryption-help

public static byte[] encrypt(
    byte[] dataToEncrypt,
    char[] passPhrase,
    int algorithm,
    boolean armor
) throws IOException, PGPException, NoSuchProviderException
{
    ByteArrayOutputStream bOut = new ByteArrayOutputStream();

    OutputStream out = bOut;
    if (armor)
    {
        out = new ArmoredOutputStream(out);
    }

    PGPEncryptedDataGenerator encGen = new PGPEncryptedDataGenerator(new JcePGPDataEncryptorBuilder(algorithm).setSecureRan dom(new SecureRandom()).setProvider("BC"));
    encGen.addMethod(new JcePBEKeyEncryptionMethodGenerator(passPhrase).set Provider("BC"));

    OutputStream encOut = encGen.open(out, dataToEncrypt.length);

    encOut.write(dataToEncrypt);
    encOut.close();

    if (armor)
    {
        out.close();
    }

    return bOut.toByteArray();
}

byte[] encrypted = encrypt(dataToEncrypt, passArray, PGPEncryptedDataGenerator.CAST5, true);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The link here points to a Javascript implementation of the said Algorithm. You can implement this within a transformer step of the source connector. Better still, you can compile the above code into a jar file that you can load to Mirth Connect's custom libs folder. A good starting point for working with custom Java codes is this

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!