ParametersWithID.cs 1008 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
  6. {
  7. public class ParametersWithID
  8. : ICipherParameters
  9. {
  10. private readonly ICipherParameters parameters;
  11. private readonly byte[] id;
  12. public ParametersWithID(ICipherParameters parameters,
  13. byte[] id)
  14. : this(parameters, id, 0, id.Length)
  15. {
  16. }
  17. public ParametersWithID(ICipherParameters parameters,
  18. byte[] id, int idOff, int idLen)
  19. {
  20. this.parameters = parameters;
  21. this.id = Arrays.CopyOfRange(id, idOff, idOff + idLen);
  22. }
  23. public byte[] GetID()
  24. {
  25. return id;
  26. }
  27. public ICipherParameters Parameters
  28. {
  29. get { return parameters; }
  30. }
  31. }
  32. }
  33. #pragma warning restore
  34. #endif