summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2014-05-27 12:04:35 -0700
committerKenny Root <kroot@google.com>2014-05-27 12:04:39 -0700
commita99c6e9a3341711ca47a61a9f0fe69441e831a38 (patch)
tree075d22c3c58e1b85e19e9b65a04f36c0d9252f25 /luni
parent322cabe3492bb1dd9d590047f9f1f3f55212ffdd (diff)
downloadlibcore-a99c6e9a3341711ca47a61a9f0fe69441e831a38.zip
libcore-a99c6e9a3341711ca47a61a9f0fe69441e831a38.tar.gz
libcore-a99c6e9a3341711ca47a61a9f0fe69441e831a38.tar.bz2
ECParameterSpec: move curve selection to non-final
This allows us to set the curve name in unbundled apps. Change-Id: Ie869b80aa7f70c7ed56cc7d8232df8ee0c2159f7
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/java/security/spec/ECParameterSpec.java24
1 files changed, 10 insertions, 14 deletions
diff --git a/luni/src/main/java/java/security/spec/ECParameterSpec.java b/luni/src/main/java/java/security/spec/ECParameterSpec.java
index 9860ac0..37b39ac 100644
--- a/luni/src/main/java/java/security/spec/ECParameterSpec.java
+++ b/luni/src/main/java/java/security/spec/ECParameterSpec.java
@@ -32,7 +32,7 @@ public class ECParameterSpec implements AlgorithmParameterSpec {
// Cofactor
private final int cofactor;
// Name of curve if available.
- private final String curveName;
+ private String curveName;
/**
* Creates a new {@code ECParameterSpec} with the specified elliptic curve,
@@ -52,23 +52,10 @@ public class ECParameterSpec implements AlgorithmParameterSpec {
*/
public ECParameterSpec(EllipticCurve curve, ECPoint generator,
BigInteger order, int cofactor) {
- this(curve, generator, order, cofactor, null);
- }
-
- /**
- * Creates a new {@code ECParameterSpec} with the specified named curve
- * and all of its parameters.
- *
- * @see #ECParameterSpec(EllipticCurve, ECPoint, BigInteger, int)
- * @hide
- */
- public ECParameterSpec(EllipticCurve curve, ECPoint generator,
- BigInteger order, int cofactor, String curveName) {
this.curve = curve;
this.generator = generator;
this.order = order;
this.cofactor = cofactor;
- this.curveName = curveName;
// throw NullPointerException if curve, generator or order is null
if (this.curve == null) {
throw new NullPointerException("curve == null");
@@ -125,6 +112,15 @@ public class ECParameterSpec implements AlgorithmParameterSpec {
}
/**
+ * Used to set the curve name if available.
+ *
+ * @hide
+ */
+ public void setCurveName(String curveName) {
+ this.curveName = curveName;
+ }
+
+ /**
* Returns the name of the curve if this is a named curve. Returns
* {@code null} if this is not known to be a named curve.
*