ECKeyGenerationParameters.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
  5. using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro;
  6. using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
  7. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
  8. {
  9. public class ECKeyGenerationParameters
  10. : KeyGenerationParameters
  11. {
  12. private readonly ECDomainParameters domainParams;
  13. private readonly DerObjectIdentifier publicKeyParamSet;
  14. public ECKeyGenerationParameters(
  15. ECDomainParameters domainParameters,
  16. SecureRandom random)
  17. : base(random, domainParameters.N.BitLength)
  18. {
  19. this.domainParams = domainParameters;
  20. }
  21. public ECKeyGenerationParameters(
  22. DerObjectIdentifier publicKeyParamSet,
  23. SecureRandom random)
  24. : this(ECKeyParameters.LookupParameters(publicKeyParamSet), random)
  25. {
  26. this.publicKeyParamSet = publicKeyParamSet;
  27. }
  28. public ECDomainParameters DomainParameters
  29. {
  30. get { return domainParams; }
  31. }
  32. public DerObjectIdentifier PublicKeyParamSet
  33. {
  34. get { return publicKeyParamSet; }
  35. }
  36. }
  37. }
  38. #pragma warning restore
  39. #endif