Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'prov/src/main/java/org/spongycastle/jce/spec/ECPublicKeySpec.java')
-rw-r--r--prov/src/main/java/org/spongycastle/jce/spec/ECPublicKeySpec.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/prov/src/main/java/org/spongycastle/jce/spec/ECPublicKeySpec.java b/prov/src/main/java/org/spongycastle/jce/spec/ECPublicKeySpec.java
new file mode 100644
index 00000000..e2888d38
--- /dev/null
+++ b/prov/src/main/java/org/spongycastle/jce/spec/ECPublicKeySpec.java
@@ -0,0 +1,42 @@
+package org.spongycastle.jce.spec;
+
+import org.spongycastle.math.ec.ECPoint;
+
+/**
+ * Elliptic Curve public key specification
+ */
+public class ECPublicKeySpec
+ extends ECKeySpec
+{
+ private ECPoint q;
+
+ /**
+ * base constructor
+ *
+ * @param q the public point on the curve.
+ * @param spec the domain parameters for the curve.
+ */
+ public ECPublicKeySpec(
+ ECPoint q,
+ ECParameterSpec spec)
+ {
+ super(spec);
+
+ if (q.getCurve() != null)
+ {
+ this.q = q.normalize();
+ }
+ else
+ {
+ this.q = q;
+ }
+ }
+
+ /**
+ * return the public point q
+ */
+ public ECPoint getQ()
+ {
+ return q;
+ }
+}