Source code: cryptix/jce/provider/dsa/DSAPublicKeyImpl.java
1 /* $Id: DSAPublicKeyImpl.java,v 1.5 2000/02/19 03:01:35 gelderen Exp $
2 *
3 * Copyright (C) 1995-1999 The Cryptix Foundation Limited.
4 * All rights reserved.
5 *
6 * Use, modification, copying and distribution of this software is subject
7 * the terms and conditions of the Cryptix General Licence. You should have
8 * received a copy of the Cryptix General Licence along with this library;
9 * if not, you can download a copy from http://www.cryptix.org/ .
10 */
11 package cryptix.jce.provider.dsa;
12
13
14 import java.math.BigInteger;
15 import java.security.interfaces.DSAParams;
16 import java.security.interfaces.DSAPublicKey;
17
18
19 /**
20 * Public key for DSA. No parameter checking is done.
21 *
22 * @author Jeroen C. van Gelderen (gelderen@cryptix.org)
23 */
24 final class DSAPublicKeyImpl
25 implements DSAPublicKey
26 {
27
28 // Class variables
29 //...........................................................................
30
31 public static final long serialVersionUID = 0L; //XXX
32
33
34 // Instance varibles
35 //...........................................................................
36
37 /** Public value y */
38 private final BigInteger y;
39
40 /** DSA parameters (g, q, p) */
41 private final DSAParams params;
42
43
44 // Constructor
45 //...........................................................................
46
47 /**
48 * Construct a public key from the given values.
49 * No parameter checking is done.
50 */
51 /*package*/ DSAPublicKeyImpl(BigInteger y, DSAParams params)
52 {
53 this.y = y;
54 this.params = params;
55 }
56
57
58
59 // Methods from DSAPublicKey
60 //...........................................................................
61
62 /**
63 * Returns public value Y.
64 */
65 public BigInteger getY()
66 {
67 return y;
68 }
69
70
71 // Methods from DSAKey
72 //...........................................................................
73
74 /**
75 * Return DSA parameters (g,q, p).
76 */
77 public DSAParams getParams()
78 {
79 return params;
80 }
81
82
83 // Methods from Key
84 //...........................................................................
85
86 public String getAlgorithm()
87 {
88 throw new RuntimeException(); //XXX
89 }
90
91
92 public String getFormat()
93 {
94 throw new RuntimeException(); //XXX
95 }
96
97
98 public byte[] getEncoded()
99 {
100 throw new RuntimeException(); //XXX
101 }
102 }