ECKeyGenerationParameters.cs 1.1 KB

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