private void generateKeyPairs() {
        try {
            final ECNamedCurveParameterSpec parameterSpec = ECNamedCurveTable.getParameterSpec("secp256r1");
            final KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("ECDH", "SC");
            keyPairGenerator.initialize(parameterSpec);
            final KeyPair keyPair = keyPairGenerator.generateKeyPair();
            final ECPublicKey publicKey = (ECPublicKey) keyPair.getPublic();

            mProvisionerPrivateKey = (ECPrivateKey) keyPair.getPrivate();

            final ECPoint point = publicKey.getQ();

            final BigInteger x = point.getXCoord().toBigInteger();
            final BigInteger y = point.getYCoord().toBigInteger();
            final byte[] tempX = BigIntegers.asUnsignedByteArray(32, x);
            final byte[] tempY = BigIntegers.asUnsignedByteArray(32, y);

            MeshLogger.verbose(TAG, "X: length: " + tempX.length + " " + MeshParserUtils.bytesToHex(tempX, false));
            MeshLogger.verbose(TAG, "Y: length: " + tempY.length + " " + MeshParserUtils.bytesToHex(tempY, false));

            final byte[] tempXY = new byte[64];
            System.arraycopy(tempX, 0, tempXY, 0, tempX.length);
            System.arraycopy(tempY, 0, tempXY, tempY.length, tempY.length);

            node.setProvisionerPublicKeyXY(tempXY);

            MeshLogger.verbose(TAG, "XY: " + MeshParserUtils.bytesToHex(tempXY, true));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
Constructs the provisioning publick key state.

@param node                        {@link UnprovisionedMeshNode} node.
@param internalTransportCallbacks  {@link InternalTransportCallbacks} callbacks.
@param provisioningStatusCallbacks {@link MeshProvisioningStatusCallbacks} callbacks.
mesh/src/main/java/no/nordicsemi/android/mesh/provisionerstates/ProvisioningPublicKeyState.java