Re: JCE1.2- AlgorithmNotFound

Jan Luehe (Jan.Luehe@Eng)
Tue, 13 Jan 1998 12:41:23 -0800 (PST)

Date: Tue, 13 Jan 1998 12:41:23 -0800 (PST)
From: Jan Luehe <Jan.Luehe@Eng>
Subject: Re: JCE1.2- AlgorithmNotFound
To: java-security@web1.javasoft.com, jstinson@tor-srs2.netcom.ca

John:

> It ended on AlgorithmNotFound Exception then a NullPointer. It was
> looking for DES.

The problem is that you forgot to register the SunJCE provider.
Actually, you had commented out the relevant lines in your code.

There are 2 ways to register the SunJCE provider:

1. Dynamic registration:

Add the following lines code at the beginning of your program:

Provider sunJCE = new com.sun.crypto.provider.SunJCE();
Security.addProvider(sunJCE);

2. Static registration:

Add the following line to the security property file of your
JDK installation, where you configure your crypto providers:

security.provider.2=com.sun.crypto.provider.SunJCE

> I've attached the 35 lines of code.
>
> Is there a quick answer to my problem?

This will do it.

Jan