/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 4917233 6461727 6490213 6720456
* @summary test the KeyGenerator
* @author Andreas Sterbenz
* @library ..
*/
enum TestResult {
PASS,
FAIL,
}
main(new TestKeyGenerator());
}
throws Exception {
try {
} catch (NoSuchAlgorithmException e) {
return TestResult.PASS;
}
try {
} catch (InvalidParameterException ipe) {
}
try {
" using invalid key length");
}
} catch (ProviderException e) {
e.printStackTrace();
("key generation failed using valid length").initCause(e));
}
}
actual);
}
return actual;
}
// Special handling since not all PKCS11 providers support
// 2-key DESede, e.g. SunPKCS11-Solaris.
// Different PKCS11 impls have different ranges
// of supported key sizes for variable-key-length
// algorithms.
// Solaris> Blowfish: 32-128 or even 448 bits, RC4: 8-128 bits or as much as 2048 bits
// NSS> Blowfish: n/a, RC4: 8-2048 bits
// However, we explicitly disallowed key sizes less
// than 40-bits.
}
}
}