01: package org.bouncycastle.jce.spec;
02:
03: import java.math.BigInteger;
04: import java.security.spec.KeySpec;
05:
06: /**
07: * This class specifies a GOST3410-94 private key with its associated parameters.
08: */
09:
10: public class GOST3410PrivateKeySpec implements KeySpec {
11: private BigInteger x;
12: private BigInteger p;
13: private BigInteger q;
14: private BigInteger a;
15:
16: /**
17: * Creates a new GOST3410PrivateKeySpec with the specified parameter values.
18: *
19: * @param x the private key.
20: * @param p the prime.
21: * @param q the sub-prime.
22: * @param a the base.
23: */
24: public GOST3410PrivateKeySpec(BigInteger x, BigInteger p,
25: BigInteger q, BigInteger a) {
26: this .x = x;
27: this .p = p;
28: this .q = q;
29: this .a = a;
30: }
31:
32: /**
33: * Returns the private key <code>x</code>.
34: * @return the private key <code>x</code>.
35: */
36: public BigInteger getX() {
37: return this .x;
38: }
39:
40: /**
41: * Returns the prime <code>p</code>.
42: * @return the prime <code>p</code>.
43: */
44: public BigInteger getP() {
45: return this .p;
46: }
47:
48: /**
49: * Returns the sub-prime <code>q</code>.
50: * @return the sub-prime <code>q</code>.
51: */
52: public BigInteger getQ() {
53: return this .q;
54: }
55:
56: /**
57: * Returns the base <code>a</code>.
58: * @return the base <code>a</code>.
59: */
60: public BigInteger getA() {
61: return this.a;
62: }
63: }
|