ECPublicKeySpec.java revision 5db505e1f6a68c8d5dfdb0fed0b8607dea7bed96
1package org.bouncycastle.jce.spec;
2
3import org.bouncycastle.math.ec.ECPoint;
4
5/**
6 * Elliptic Curve public key specification
7 */
8public class ECPublicKeySpec
9    extends ECKeySpec
10{
11    private ECPoint    q;
12
13    /**
14     * base constructor
15     *
16     * @param q the public point on the curve.
17     * @param spec the domain parameters for the curve.
18     */
19    public ECPublicKeySpec(
20        ECPoint         q,
21        ECParameterSpec spec)
22    {
23        super(spec);
24
25        if (q.getCurve() != null)
26        {
27            this.q = q.normalize();
28        }
29        else
30        {
31            this.q = q;
32        }
33    }
34
35    /**
36     * return the public point q
37     */
38    public ECPoint getQ()
39    {
40        return q;
41    }
42}
43