1 7 package java.security.spec; 8 9 import java.math.BigInteger ; 10 11 22 public class ECParameterSpec implements AlgorithmParameterSpec { 23 24 private final EllipticCurve curve; 25 private final ECPoint g; 26 private final BigInteger n; 27 private final int h; 28 29 42 public ECParameterSpec(EllipticCurve curve, ECPoint g, 43 BigInteger n, int h) { 44 if (curve == null) { 45 throw new NullPointerException ("curve is null"); 46 } 47 if (g == null) { 48 throw new NullPointerException ("g is null"); 49 } 50 if (n == null) { 51 throw new NullPointerException ("n is null"); 52 } 53 if (n.signum() != 1) { 54 throw new IllegalArgumentException ("n is not positive"); 55 } 56 if (h <= 0) { 57 throw new IllegalArgumentException ("h is not positive"); 58 } 59 this.curve = curve; 60 this.g = g; 61 this.n = n; 62 this.h = h; 63 } 64 65 69 public EllipticCurve getCurve() { 70 return curve; 71 } 72 73 77 public ECPoint getGenerator() { 78 return g; 79 } 80 81 85 public BigInteger getOrder() { 86 return n; 87 } 88 89 93 public int getCofactor() { 94 return h; 95 } 96 } 97 | Popular Tags |