Scripted Attribute Resolver ClassNotFoundException

cbaker craigb at clemson.edu
Tue May 31 14:30:04 EDT 2016


I'm trying to write a scripted attribute resolver that uses the java
BouncyCastle libraries to do some RSA encryption.  When trying to call
Java.type("org.bouncycastle.openssl.PEMParser") I get a
ClassNotFoundException in idp-process.  

I've included the appropriate jar files in
{shibhome}/edit-webapp/WEB-INF/lib and done a bin/build.sh. I've verified
that the appropriate Jar files are in the idp.war file.  

I'm using tomcat8 and idp 3.2.  

I attempted to put the same jars in tomcat's lib directory and while that
allowed me to get past this line without a ClassNotFoundException, java /
tomcat quickly takes up all system memory, so I'm assuming that's NOT the
right answer.  

Heres the contents of the offending AttributeDefiniton's <script> tag:

	var ByteArray = Java.type("byte[]");
	var System = Java.type("java.lang.System");
	var FileReader = Java.type("java.io.FileReader");

	var Security = Java.type("java.security.Security");
	var PrivateKey = Java.type("java.security.PrivateKey");

	var Cipher = Java.type("javax.crypto.Cipher");
			
	var BouncyCastleProvider =
Java.type("org.bouncycastle.jce.provider.BouncyCastleProvider");
	var PEMParser = Java.type("org.bouncycastle.openssl.PEMParser");

Curiously the nashorn interpreter doesn't throw an exception on the
BouncyCastleProvider line, which comes from the same set of jars.  I've also
been able to add other libs like svnkit to the war using the same
edit-webapp location and rebuilding, so I don't think I'm doing that part
wrong.  

Any thoughts?

Thanks!
-Craig B





--
View this message in context: http://shibboleth.1660669.n2.nabble.com/Scripted-Attribute-Resolver-ClassNotFoundException-tp7625851.html
Sent from the Shibboleth - Users mailing list archive at Nabble.com.


More information about the users mailing list