DTLS 1.2 Master key derivation
<p>I am implementing <strong>DTLS 1.2</strong> and using cipher <strong>TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256</strong></p>

<p>I am creating pre-master secret and master secret key using following steps</p>

<p>1- Open algorithm provider using API <strong>BCryptOpenAlgorithmProvider</strong></p>

<p>2- Generate key pair using API <strong>BCryptGenerateKeyPair</strong></p>

<p>3- Than export public key using API <strong>BCryptExportKey</strong></p>

<p>4- Than import other party public key using API <strong>BCryptImportKeyPair</strong></p>

<p>5- After that generate secret agreement handle using my private key and other party public key by using API <strong>BCryptSecretAgreement</strong></p>

<p>6- Finally get secret key using API <strong>BCryptDeriveKey</strong></p>

<p>Am i missing something because my master key is not correct.</p>