01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * @author Vladimir N. Molotkov
20: * @version $Revision$
21: */package java.security.spec;
22:
23: import org.apache.harmony.security.internal.nls.Messages;
24:
25: /**
26: * @com.intel.drl.spec_ref
27: *
28: */
29: public class ECPublicKeySpec implements KeySpec {
30: // The public point
31: private final ECPoint w;
32: // The associated elliptic curve domain parameters
33: private final ECParameterSpec params;
34:
35: /**
36: * @com.intel.drl.spec_ref
37: */
38: public ECPublicKeySpec(ECPoint w, ECParameterSpec params) {
39: this .w = w;
40: this .params = params;
41: // throw NullPointerException if w or params is null
42: if (this .w == null) {
43: throw new NullPointerException(Messages.getString(
44: "security.83", "w")); //$NON-NLS-1$ //$NON-NLS-2$
45: }
46: if (this .params == null) {
47: throw new NullPointerException(Messages.getString(
48: "security.83", "params")); //$NON-NLS-1$ //$NON-NLS-2$
49: }
50: // throw IllegalArgumentException if w is point at infinity
51: if (this .w.equals(ECPoint.POINT_INFINITY)) {
52: throw new IllegalArgumentException(Messages
53: .getString("security.84")); //$NON-NLS-1$
54: }
55: }
56:
57: /**
58: * @com.intel.drl.spec_ref
59: */
60: public ECParameterSpec getParams() {
61: return params;
62: }
63:
64: /**
65: * @com.intel.drl.spec_ref
66: */
67: public ECPoint getW() {
68: return w;
69: }
70: }
|