× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.


"error"
Exception in thread "main" java.lang.NoClassDefFoundError: SecureBlackbox.Base.TElStream
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:90)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:167)
Caused by: java.lang.ClassNotFoundException: SecureBlackbox.Base.TElStream
at java.net.URLClassLoader.findClass(URLClassLoader.java:599)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:711)
at java.lang.ClassLoader.loadClass(ClassLoader.java:679)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:325)
at java.lang.ClassLoader.loadClass(ClassLoader.java:658)
... 3 more

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

"ls" of the folder:
Javagpg$1.class
Javagpg.class
Javagpg.java
SecureBlackbox.Base.jar
SecureBlackbox.PGP.jar
compile_javagpg.sh
lib
manifest.mf

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];
SBUtils.setLicenseKey("30C...6F9");
TElPGPKeyring keyring = new TElPGPKeyring();
TElPGPReader pgpReader;
pgpReader = new TElPGPReader();
pgpReader.setOnCreateOutputStream(new TSBPGPCreateOutputStreamEvent(outStreamCallback));
keyring.load("/PGPcerts/publickey.asc", "/PGPcerts/privatekey.asc", true);
pgpReader.setDecryptingKeys(keyring);
pgpReader.setVerifyingKeys(keyring);
TSBString a = new TSBString();
a.value = "14144t!";
pgpReader.setKeyPassphrase(a);
a.value = outfile + ".TXT";
pgpReader.setOutputFile(a);

TElFileStream inF = new TElFileStream(outfile, "rw", true);
pgpReader.decryptAndVerify(inF, 0);
inF.Free();
System.exit(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-Ups:

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

This mailing list archive is Copyright 1997-2024 by midrange.com 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.