FileDocCategorySizeDatePackage
Import.javaAPI DocExample2005Sun Oct 25 18:13:36 GMT 1998None

Import

public class Import extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		try {
			FileInputStream fis = new FileInputStream("exportedKey");
			ObjectInputStream ois = new ObjectInputStream(fis);
			DSAPrivateKeySpec ks = new DSAPrivateKeySpec(
						(BigInteger) ois.readObject(),
						(BigInteger) ois.readObject(),
						(BigInteger) ois.readObject(),
						(BigInteger) ois.readObject());
			KeyFactory kf = KeyFactory.getInstance("DSA");
			PrivateKey pk = kf.generatePrivate(ks);
			System.out.println("Got private key");
		} catch (Exception e) {
			e.printStackTrace();
		}