Code example for StringTokenizer

Methods: nextToken

0
		return b.toString();
	} 
 
	public static CryptoKey readFromField(String field) {
		BigInteger p, g;
		StringTokenizer str = new StringTokenizer(field, ",");
		p = new NativeBigInteger(1, HexUtil.hexToBytes(str.nextToken()));
		g = new NativeBigInteger(1, HexUtil.hexToBytes(str.nextToken()));
		return new DHGroup(p, g);
	} 
 
	public static CryptoKey read(DataInputStream i) throws IOException {
		BigInteger p, g;
		p = Util.readMPI(i);
		g = Util.readMPI(i);
		return new DHGroup(p, g);
	} 
 
	public BigInteger getP() {
		return p;
	}