2362N/A * Copyright (c) 2009, 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 * KeyAgreement implementation for ECDH. 1545N/A // private key, if initialized 1545N/A // encoded public point, non-null between doPhase() & generateSecret() only 1545N/A // length of the secret to be derived 1545N/A * Constructs a new ECDHKeyAgreement. 1545N/A (
"Key must be instance of PrivateKey");
1545N/A (
"Parameters not supported");
1545N/A (
"Only two party agreement supported, lastPhase must be true");
1545N/A (
"Key must be a PublicKey with algorithm EC");
1545N/A }
else {
// instanceof ECPublicKey 1545N/A (
"Only supported for algorithm TlsPremasterSecret");
1545N/A * Generates a secret key using the public and private keys. 1545N/A * @param s the private key's S value. 1545N/A * @param w the public key's W point (in uncompressed form). 1545N/A * @param encodedParams the curve's DER encoded object identifier. 1545N/A * @return byte[] the secret key.