GOST3410PublicKeyParameters.cs 930 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. using Org.BouncyCastle.Asn1;
  4. using Org.BouncyCastle.Math;
  5. namespace Org.BouncyCastle.Crypto.Parameters
  6. {
  7. public class Gost3410PublicKeyParameters
  8. : Gost3410KeyParameters
  9. {
  10. private readonly BigInteger y;
  11. public Gost3410PublicKeyParameters(
  12. BigInteger y,
  13. Gost3410Parameters parameters)
  14. : base(false, parameters)
  15. {
  16. if (y.SignValue < 1 || y.CompareTo(Parameters.P) >= 0)
  17. throw new ArgumentException("Invalid y for GOST3410 public key", "y");
  18. this.y = y;
  19. }
  20. public Gost3410PublicKeyParameters(
  21. BigInteger y,
  22. DerObjectIdentifier publicKeyParamSet)
  23. : base(false, publicKeyParamSet)
  24. {
  25. if (y.SignValue < 1 || y.CompareTo(Parameters.P) >= 0)
  26. throw new ArgumentException("Invalid y for GOST3410 public key", "y");
  27. this.y = y;
  28. }
  29. public BigInteger Y
  30. {
  31. get { return y; }
  32. }
  33. }
  34. }
  35. #endif