/** * Generates an SM2 keypair. * * @param control * Control of the key generation process. Must not be {@code null}. * @return the identifier of the identity within the PKCS#P11 token. * @throws P11TokenException * if PKCS#11 token exception occurs. */ // CHECKSTYLE:SKIP public P11IdentityId generateSM2Keypair(P11NewKeyControl control) throws P11TokenException { assertCanGenKeypair("generateSM2Keypair", PKCS11Constants.CKM_VENDOR_SM2_KEY_PAIR_GEN, control); P11Identity identity = generateSM2Keypair0(control); addIdentity(identity); P11IdentityId id = identity.getId(); LOG.info("generated SM2 keypair {}", id); return id; }
/** * Generates an SM2 keypair. * * @param control * Control of the key generation process. Must not be {@code null}. * @return the identifier of the identity within the PKCS#P11 token. * @throws P11TokenException * if PKCS#11 token exception occurs. */ // CHECKSTYLE:SKIP public P11IdentityId generateSM2Keypair(P11NewKeyControl control) throws P11TokenException { assertCanGenKeypair("generateSM2Keypair", PKCS11Constants.CKM_VENDOR_SM2_KEY_PAIR_GEN, control); P11Identity identity = generateSM2Keypair0(control); addIdentity(identity); P11IdentityId id = identity.getId(); LOG.info("generated SM2 keypair {}", id); return id; }