< prev index next >

src/share/classes/sun/security/rsa/RSAKeyPairGenerator.java

Print this page
rev 12543 : 8181048: Refactor existing providers to refer to the same constants for default values for key length
Reviewed-by: mullan, ahgross

*** 1,7 **** /* ! * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 30,39 **** --- 30,40 ---- import java.security.*; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.RSAKeyGenParameterSpec; import sun.security.jca.JCAUtil; + import static sun.security.util.SecurityProviderConstants.DEF_RSA_KEY_SIZE; /** * RSA keypair generation. Standard algorithm, minimum key length 512 bit. * We generate two random primes until we find two where phi is relative * prime to the public exponent. Default exponent is 65537. It has only bit 0
*** 53,63 **** // PRNG to use private SecureRandom random; public RSAKeyPairGenerator() { // initialize to default in case the app does not call initialize() ! initialize(1024, null); } // initialize the generator. See JCA doc public void initialize(int keySize, SecureRandom random) { --- 54,64 ---- // PRNG to use private SecureRandom random; public RSAKeyPairGenerator() { // initialize to default in case the app does not call initialize() ! initialize(DEF_RSA_KEY_SIZE, null); } // initialize the generator. See JCA doc public void initialize(int keySize, SecureRandom random) {
< prev index next >