PkixCertPathBuilderResult.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.Text;
  5. using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
  6. using BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix;
  7. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix
  8. {
  9. /// <summary>
  10. /// Summary description for PkixCertPathBuilderResult.
  11. /// </summary>
  12. public class PkixCertPathBuilderResult
  13. : PkixCertPathValidatorResult//, ICertPathBuilderResult
  14. {
  15. private PkixCertPath certPath;
  16. public PkixCertPathBuilderResult(
  17. PkixCertPath certPath,
  18. TrustAnchor trustAnchor,
  19. PkixPolicyNode policyTree,
  20. AsymmetricKeyParameter subjectPublicKey)
  21. : base(trustAnchor, policyTree, subjectPublicKey)
  22. {
  23. if (certPath == null)
  24. throw new ArgumentNullException("certPath");
  25. this.certPath = certPath;
  26. }
  27. public PkixCertPath CertPath
  28. {
  29. get { return certPath; }
  30. }
  31. public override string ToString()
  32. {
  33. StringBuilder s = new StringBuilder();
  34. s.Append("SimplePKIXCertPathBuilderResult: [\n");
  35. s.Append(" Certification Path: ").Append(CertPath).Append('\n');
  36. s.Append(" Trust Anchor: ").Append(this.TrustAnchor.TrustedCert.IssuerDN.ToString()).Append('\n');
  37. s.Append(" Subject Public Key: ").Append(this.SubjectPublicKey).Append("\n]");
  38. return s.ToString();
  39. }
  40. }
  41. }
  42. #pragma warning restore
  43. #endif