PKCS12StoreBuilder.cs 1.1 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.Pkcs;
  6. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs
  7. {
  8. public class Pkcs12StoreBuilder
  9. {
  10. private DerObjectIdentifier keyAlgorithm = PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc;
  11. private DerObjectIdentifier certAlgorithm = PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc;
  12. private bool useDerEncoding = false;
  13. public Pkcs12StoreBuilder()
  14. {
  15. }
  16. public Pkcs12Store Build()
  17. {
  18. return new Pkcs12Store(keyAlgorithm, certAlgorithm, useDerEncoding);
  19. }
  20. public Pkcs12StoreBuilder SetCertAlgorithm(DerObjectIdentifier certAlgorithm)
  21. {
  22. this.certAlgorithm = certAlgorithm;
  23. return this;
  24. }
  25. public Pkcs12StoreBuilder SetKeyAlgorithm(DerObjectIdentifier keyAlgorithm)
  26. {
  27. this.keyAlgorithm = keyAlgorithm;
  28. return this;
  29. }
  30. public Pkcs12StoreBuilder SetUseDerEncoding(bool useDerEncoding)
  31. {
  32. this.useDerEncoding = useDerEncoding;
  33. return this;
  34. }
  35. }
  36. }
  37. #pragma warning restore
  38. #endif