JPakeRound3Payload.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake
  6. {
  7. /// <summary>
  8. /// The payload sent/received during the optional third round of a J-PAKE exchange,
  9. /// which is for explicit key confirmation.
  10. ///
  11. /// Each JPAKEParticipant creates and sends an instance
  12. /// of this payload to the other JPAKEParticipant.
  13. /// The payload to send should be created via
  14. /// JPAKEParticipant#createRound3PayloadToSend(BigInteger)
  15. ///
  16. /// Eeach JPAKEParticipant must also validate the payload
  17. /// received from the other JPAKEParticipant.
  18. /// The received payload should be validated via
  19. /// JPAKEParticipant#validateRound3PayloadReceived(JPakeRound3Payload, BigInteger)
  20. /// </summary>
  21. public class JPakeRound3Payload
  22. {
  23. /// <summary>
  24. /// The id of the {@link JPAKEParticipant} who created/sent this payload.
  25. /// </summary>
  26. private readonly string participantId;
  27. /// <summary>
  28. /// The value of MacTag, as computed by round 3.
  29. ///
  30. /// See JPAKEUtil#calculateMacTag(string, string, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, org.bouncycastle.crypto.Digest)
  31. /// </summary>
  32. private readonly BigInteger macTag;
  33. public JPakeRound3Payload(string participantId, BigInteger magTag)
  34. {
  35. this.participantId = participantId;
  36. this.macTag = magTag;
  37. }
  38. public virtual string ParticipantId
  39. {
  40. get { return participantId; }
  41. }
  42. public virtual BigInteger MacTag
  43. {
  44. get { return macTag; }
  45. }
  46. }
  47. }
  48. #pragma warning restore
  49. #endif