title: how to generate share secret using bouncy castle
body: <p>I have 2 byte arrays of ECDSA private and public key how can i generate share secret. I have found following java code. I have tried following</p>
  
  <pre><code>ECPublicKeyParameters otherPartyPublicKey = (ECPublicKeyParameters)PublicKeyFactory.CreateKey(publicKeyBytes);
  ECPrivateKeyParameters privateKey = (ECPrivateKeyParameters) PrivateKeyFactory.CreateKey(privateKeyBytes);
  IBasicAgreement aKeyAgree = AgreementUtilities.GetBasicAgreement("ECDH");
          aKeyAgree.Init(privateKey);
  BigInteger sharedSecret = aKeyAgree.CalculateAgreement(otherPartyPublicKey);
  </code></pre>
  
  <p>but i'm getting error "DEF length 118 object truncated by 55" </p>