im using an api from secure black box for GPG work. i wrote a program to decrypt a file. its works fine in my pc netbean environment. when i port it over to my iseries, compile and try to run it im getting a class not found error. the class its looking for is in one of the 2 jar files that are in the same folder on the iseries. "SecureBlackbox.Base.TElStream" is located in the SecureBlackbox.Base.jar.

Exception in thread "main" java.lang.NoClassDefFoundError: SecureBlackbox.Base.TElStream
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(
at java.lang.J9VMInternals.initialize(
Caused by: java.lang.ClassNotFoundException: SecureBlackbox.Base.TElStream
at java.lang.ClassLoader.loadClassHelper(
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
... 3 more

"command line" used to run:
java Javagpg -cp SecureBlackbox.PGP.jar:SecureBlackbox.Base.jar

"ls" of the folder:

Java Code:
import SecureBlackbox.Base.SBUtils;
import SecureBlackbox.PGP.TElPGPCreateStreamEventParams;
import SecureBlackbox.PGP.TElPGPKeyring;
import SecureBlackbox.PGP.TElPGPReader;
import SecureBlackbox.PGP.TSBPGPCreateOutputStreamEvent;
import java.util.Date;
import org.freepascal.rtl.TObject;
import SecureBlackbox.Base.TElFileStream;
import SecureBlackbox.Base.TSBString;

public class Javagpg {
static String outfile;

public static void main(String[] args) {
outfile = args[0];
TElPGPKeyring keyring = new TElPGPKeyring();
TElPGPReader pgpReader;
pgpReader = new TElPGPReader();
pgpReader.setOnCreateOutputStream(new TSBPGPCreateOutputStreamEvent(outStreamCallback));
keyring.load("/PGPcerts/publickey.asc", "/PGPcerts/privatekey.asc", true);
TSBString a = new TSBString();
a.value = "14144t!";
a.value = outfile + ".TXT";

TElFileStream inF = new TElFileStream(outfile, "rw", true);
pgpReader.decryptAndVerify(inF, 0);

static TSBPGPCreateOutputStreamEvent.Callback outStreamCallback = new TSBPGPCreateOutputStreamEvent.Callback() {
public void tsbpgpCreateOutputStreamEventCallback(TObject sender,
String fileName,
Date timeStamp,
TElPGPCreateStreamEventParams streamParams) {
String target = outfile + ".txt";
streamParams.Stream = new TElFileStream(target, "rw", true);
streamParams.FreeOnFinish = true;

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.