DERInteger p = (DERInteger) seq.getObjectAt(1);
DERInteger q = (DERInteger) seq.getObjectAt(2);
DERInteger g = (DERInteger) seq.getObjectAt(3);
DERInteger y = (DERInteger) seq.getObjectAt(4);
DERInteger x = (DERInteger) seq.getObjectAt(5);
privSpec = new DSAPrivateKeySpec(x.getValue(), p.getValue(), q.getValue(), g.getValue());
pubSpec = new DSAPublicKeySpec(y.getValue(), p.getValue(), q.getValue(), g.getValue());
}
KeyFactory fact = KeyFactory.getInstance(type);
return new KeyPair(fact.generatePublic(pubSpec), fact.generatePrivate(privSpec));
}