4111N/A * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. 1545N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1545N/A * This code is free software; you can redistribute it and/or modify it 1545N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 1545N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 1545N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1545N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1545N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1545N/A * version 2 for more details (a copy is included in the LICENSE file that 1545N/A * You should have received a copy of the GNU General Public License version 1545N/A * 2 along with this work; if not, write to the Free Software Foundation, 1545N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1545N/A * Standard algorithm, minimum key length is 112 bits, maximum is 571 bits. 1545N/A // used to seed the keypair generator 1545N/A // size of the key to generate, KEY_SIZE_MIN <= keySize <= KEY_SIZE_MAX 1545N/A // parameters specified via init, if any 1545N/A * Constructs a new ECKeyPairGenerator. 1545N/A // initialize to default in case the app does not call initialize() 1545N/A // initialize the generator. See JCA doc 1545N/A "No EC parameters available for key size " +
keySize +
" bits");
1545N/A // second initialize method. See JCA doc 1545N/A "ECParameterSpec or ECGenParameterSpec required for EC");
1545N/A // generate the keypair. See JCA doc 1674N/A // seed is twice the key size (in bytes) plus 1 4111N/A // The 'params' object supplied above is equivalent to the native 4111N/A // one so there is no need to fetch it. 4111N/A // handles[0] points to the native private key 1545N/A // handles[1] points to the native public key 1545N/A * Generates the keypair and returns a 2-element array of handles. 1545N/A * The first handle points to the private key, the second to the public key. 1545N/A * Extracts the encoded key data using the supplied handle.