equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
49 |
49 |
50 /** |
50 /** |
51 * Construct a key from its components. Used by the |
51 * Construct a key from its components. Used by the |
52 * ECKeyFactory and SunPKCS11. |
52 * ECKeyFactory and SunPKCS11. |
53 */ |
53 */ |
|
54 @SuppressWarnings("deprecation") |
54 public ECPublicKeyImpl(ECPoint w, ECParameterSpec params) |
55 public ECPublicKeyImpl(ECPoint w, ECParameterSpec params) |
55 throws InvalidKeyException { |
56 throws InvalidKeyException { |
56 this.w = w; |
57 this.w = w; |
57 this.params = params; |
58 this.params = params; |
58 // generate the encoding |
59 // generate the encoding |
83 return params; |
84 return params; |
84 } |
85 } |
85 |
86 |
86 // Internal API to get the encoded point. Currently used by SunPKCS11. |
87 // Internal API to get the encoded point. Currently used by SunPKCS11. |
87 // This may change/go away depending on what we do with the public API. |
88 // This may change/go away depending on what we do with the public API. |
|
89 @SuppressWarnings("deprecation") |
88 public byte[] getEncodedPublicValue() { |
90 public byte[] getEncodedPublicValue() { |
89 return key.clone(); |
91 return key.clone(); |
90 } |
92 } |
91 |
93 |
92 /** |
94 /** |
93 * Parse the key. Called by X509Key. |
95 * Parse the key. Called by X509Key. |
94 */ |
96 */ |
|
97 @SuppressWarnings("deprecation") |
95 protected void parseKeyBits() throws InvalidKeyException { |
98 protected void parseKeyBits() throws InvalidKeyException { |
96 try { |
99 try { |
97 AlgorithmParameters algParams = this.algid.getParameters(); |
100 AlgorithmParameters algParams = this.algid.getParameters(); |
98 params = algParams.getParameterSpec(ECParameterSpec.class); |
101 params = algParams.getParameterSpec(ECParameterSpec.class); |
99 w = ECParameters.decodePoint(key, params.getCurve()); |
102 w = ECParameters.decodePoint(key, params.getCurve()); |