# Re: javax.crypto.KeyGenerator(Spi)

Jan Luehe (luehe@laguna.eng.sun.com)
Mon, 27 Jul 1998 10:16:16 -0700 (PDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: David B. Wadsworth - Java Specialist: "JAR and JCE"
- Previous message: Jan Luehe: "Re: javax.crypto.KeyGenerator(Spi)"
- Maybe in reply to: Jeroen C. van Gelderen: "javax.crypto.KeyGenerator(Spi)"

    Date: Mon, 27 Jul 1998 10:16:16 -0700 (PDT)

    From: Jan Luehe <luehe@laguna.eng.sun.com>

    Subject: Re: javax.crypto.KeyGenerator(Spi)

    To: java-security@java.Sun.COM, gelderen@mediaport.org

Jeroen:

> Have a look at the javax.crypto.KeyGenerator(Spi) classes and ask
> yourself:
>
> What if if call engineGenerateSecret(1024, new SecureRandomStuff()) on
> a DES key generator instance? My guess is that you should define an
> exception here...

You're talking about the "engineInit" method, right?

Note that this is consistent with

java.security.KeyPairGeneratorSpi.initialize(int strength,
SecureRandom random)

which has been around since JDK 1.1.x.
Implementations of those methods should raise a
java.security.InvalidParameterException exception
(which extends java.lang.IllegalArgumentException, which
extends java.security.RuntimeException) in situations like the one
you described, in which there is no recovery.

Jan

- Next message: David B. Wadsworth - Java Specialist: "JAR and JCE"
- Previous message: Jan Luehe: "Re: javax.crypto.KeyGenerator(Spi)"
- Maybe in reply to: Jeroen C. van Gelderen: "javax.crypto.KeyGenerator(Spi)"