PkixCertPathBuilderResult.cs 1.3 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 sb = new StringBuilder();
  34. sb.AppendLine("SimplePKIXCertPathBuilderResult: [");
  35. sb.Append(" Certification Path: ").Append(CertPath).AppendLine();
  36. sb.Append(" Trust Anchor: ").Append(TrustAnchor.TrustedCert.IssuerDN).AppendLine();
  37. sb.Append(" Subject Public Key: ").Append(SubjectPublicKey).AppendLine();
  38. return sb.ToString();
  39. }
  40. }
  41. }
  42. #pragma warning restore
  43. #endif