use of iaik.pkcs.pkcs11.objects.DSAPrivateKey in project xipki by xipki.
the class IaikP11Slot method generateDSAKeypair0.
@Override
protected // CHECKSTYLE:SKIP
P11Identity generateDSAKeypair0(BigInteger p, BigInteger q, BigInteger g, String label, P11NewKeyControl control) throws P11TokenException {
long mech = PKCS11Constants.CKM_DSA_KEY_PAIR_GEN;
assertMechanismSupported(mech);
DSAPrivateKey privateKey = new DSAPrivateKey();
DSAPublicKey publicKey = new DSAPublicKey();
setKeyAttributes(label, PKCS11Constants.CKK_DSA, control, publicKey, privateKey);
publicKey.getPrime().setByteArrayValue(p.toByteArray());
publicKey.getSubprime().setByteArrayValue(q.toByteArray());
publicKey.getBase().setByteArrayValue(g.toByteArray());
return generateKeyPair(mech, privateKey, publicKey);
}
Aggregations