use of java.security.spec.DSAParameterSpec in project XobotOS by xamarin.
the class JDKDSAPrivateKey method readObject.
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
this.x = (BigInteger) in.readObject();
this.dsaSpec = new DSAParameterSpec((BigInteger) in.readObject(), (BigInteger) in.readObject(), (BigInteger) in.readObject());
this.attrCarrier = new PKCS12BagAttributeCarrierImpl();
attrCarrier.readObject(in);
}
use of java.security.spec.DSAParameterSpec in project robovm by robovm.
the class KeyPairGenerator4Test method test_initializeLjava_security_spec_AlgorithmParameterSpec.
/**
* java.security.KeyPairGenerator#initialize(java.security.spec.AlgorithmParameterSpec)
*/
public void test_initializeLjava_security_spec_AlgorithmParameterSpec() throws Exception {
// create DSAParams
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA");
keyPairGenerator.initialize(1024);
DSAPublicKey key = (DSAPublicKey) keyPairGenerator.genKeyPair().getPublic();
DSAParams params = key.getParams();
KeyPairGenerator keyPair = KeyPairGenerator.getInstance("DSA");
keyPair.initialize(new DSAParameterSpec(params.getP(), params.getQ(), params.getG()));
}
use of java.security.spec.DSAParameterSpec in project robovm by robovm.
the class KeyPairGenerator4Test method test_initializeLjava_security_spec_AlgorithmParameterSpecLjava_security_SecureRandom.
/**
* java.security.KeyPairGenerator#initialize(java.security.spec.AlgorithmParameterSpec,
* java.security.SecureRandom)
*/
public void test_initializeLjava_security_spec_AlgorithmParameterSpecLjava_security_SecureRandom() throws Exception {
// create DSAParams
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA");
keyPairGenerator.initialize(1024);
DSAPublicKey key = (DSAPublicKey) keyPairGenerator.genKeyPair().getPublic();
DSAParams params = key.getParams();
KeyPairGenerator keyPair = KeyPairGenerator.getInstance("DSA");
keyPair.initialize(new DSAParameterSpec(params.getP(), params.getQ(), params.getG()), new SecureRandom());
}
use of java.security.spec.DSAParameterSpec in project robovm by robovm.
the class BCDSAPublicKey method readObject.
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
this.dsaSpec = new DSAParameterSpec((BigInteger) in.readObject(), (BigInteger) in.readObject(), (BigInteger) in.readObject());
}
use of java.security.spec.DSAParameterSpec in project robovm by robovm.
the class DSAParamsTest method test_getQ.
/**
* java.security.interfaces.DSAParams
* #getQ()
*/
public void test_getQ() {
DSAParams params = new DSAParameterSpec(p, q, g);
assertEquals("Invalid Q", q, params.getQ());
}
Aggregations