dsaprivatekeyspec.java

来自「kaffe Java 解释器语言,源码,Java的子集系统,开放源代码」· Java 代码 · 共 80 行

JAVA
80
字号
/* * DSAPrivateKeySpec.java * * Copyright (c) 2001 University of Utah and the Flux Group. * All rights reserved. * * This file is licensed under the terms of the GNU Public License. * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * Contributed by the Flux Research Group, Department of Computer Science, * University of Utah, http://www.cs.utah.edu/flux/ */package java.security.spec;import java.math.BigInteger;public class DSAPrivateKeySpec    implements KeySpec{    private final BigInteger x;    private final BigInteger p;    private final BigInteger q;    private final BigInteger g;        public DSAPrivateKeySpec(BigInteger x,			     BigInteger p,			     BigInteger q,			     BigInteger g)    {	/* XXX Are these checks valid? */	if( x.signum() < 0 )	    throw new IllegalArgumentException();	if( p.signum() < 0 )	    throw new IllegalArgumentException();	if( q.signum() < 0 )	    throw new IllegalArgumentException();	if( g.signum() < 0 )	    throw new IllegalArgumentException();	this.x = x;	this.p = p;	this.q = q;	this.g = g;    }    public BigInteger getX()    {	return this.x;    }        public BigInteger getP()    {	return this.p;    }        public BigInteger getQ()    {	return this.q;    }        public BigInteger getG()    {	return this.g;    }    public String toString()    {	return "DSAPrivateKeySpec[x="	    + this.x	    + "; p="	    + this.p	    + "; q="	    + this.q	    + "; g="	    + this.g	    + "]";    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?