IesParameters.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
  6. {
  7. /**
  8. * parameters for using an integrated cipher in stream mode.
  9. */
  10. public class IesParameters : ICipherParameters
  11. {
  12. private byte[] derivation;
  13. private byte[] encoding;
  14. private int macKeySize;
  15. /**
  16. * @param derivation the derivation parameter for the KDF function.
  17. * @param encoding the encoding parameter for the KDF function.
  18. * @param macKeySize the size of the MAC key (in bits).
  19. */
  20. public IesParameters(
  21. byte[] derivation,
  22. byte[] encoding,
  23. int macKeySize)
  24. {
  25. this.derivation = derivation;
  26. this.encoding = encoding;
  27. this.macKeySize = macKeySize;
  28. }
  29. public byte[] GetDerivationV()
  30. {
  31. return derivation;
  32. }
  33. public byte[] GetEncodingV()
  34. {
  35. return encoding;
  36. }
  37. public int MacKeySize
  38. {
  39. get
  40. {
  41. return macKeySize;
  42. }
  43. }
  44. }
  45. }
  46. #pragma warning restore
  47. #endif