TSKPinFailureReport.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. TSKPinFailureReport.h
  3. TrustKit
  4. Copyright 2015 The TrustKit Project Authors
  5. Licensed under the MIT license, see associated LICENSE file for terms.
  6. See AUTHORS file for the list of project authors.
  7. */
  8. #import "../Pinning/ssl_pin_verifier.h"
  9. #if __has_feature(modules)
  10. @import Foundation;
  11. #else
  12. #import <Foundation/Foundation.h>
  13. #endif
  14. @interface TSKPinFailureReport : NSObject
  15. @property (readonly, nonatomic, nonnull) NSString *appBundleId; // Not part of the HPKP spec
  16. @property (readonly, nonatomic, nonnull) NSString *appVersion; // Not part of the HPKP spec
  17. @property (readonly, nonatomic, nonnull) NSString *appPlatform; // Not part of the HPKP spec
  18. @property (readonly, nonatomic, nonnull) NSString *appPlatformVersion; // Not part of the HPKP spec
  19. @property (readonly, nonatomic, nonnull) NSString *appVendorId; // Not part of the HPKP spec
  20. @property (readonly, nonatomic, nonnull) NSString *trustkitVersion; // Not part of the HPKP spec
  21. @property (readonly, nonatomic, nonnull) NSString *notedHostname;
  22. @property (readonly, nonatomic, nonnull) NSString *hostname;
  23. @property (readonly, nonatomic, nonnull) NSNumber *port;
  24. @property (readonly, nonatomic, nonnull) NSDate *dateTime;
  25. @property (readonly, nonatomic) BOOL includeSubdomains;
  26. @property (readonly, nonatomic, nonnull) NSArray *validatedCertificateChain;
  27. @property (readonly, nonatomic, nonnull) NSArray *knownPins;
  28. @property (readonly, nonatomic) TSKTrustEvaluationResult validationResult; // Not part of the HPKP spec
  29. @property (readonly, nonatomic) BOOL enforcePinning; // Not part of the HPKP spec
  30. @property (readonly, nonatomic, nullable) NSDate *knownPinsExpirationDate; // Not part of the HPKP spec
  31. // Init with default bundle ID and current time as the date-time
  32. - (nonnull instancetype) initWithAppBundleId:(nonnull NSString *)appBundleId
  33. appVersion:(nonnull NSString *)appVersion
  34. appPlatform:(nonnull NSString *)appPlatform
  35. appPlatformVersion:(nonnull NSString *)appPlatformVersion
  36. appVendorId:(nonnull NSString *)appVendorId
  37. trustkitVersion:(nonnull NSString *)trustkitVersion
  38. hostname:(nonnull NSString *)serverHostname
  39. port:(nonnull NSNumber *)serverPort
  40. dateTime:(nonnull NSDate *)dateTime
  41. notedHostname:(nonnull NSString *)notedHostname
  42. includeSubdomains:(BOOL)includeSubdomains
  43. enforcePinning:(BOOL)enforcePinning
  44. validatedCertificateChain:(nonnull NSArray<NSString *> *)validatedCertificateChain
  45. knownPins:(nonnull NSArray<NSString *> *)knownPins
  46. validationResult:(TSKTrustEvaluationResult)validationResult
  47. expirationDate:(nullable NSDate *)knownPinsExpirationDate;
  48. // Return the report in JSON format for POSTing it
  49. - (nonnull NSData *)json;
  50. // Return a request ready to be sent with the report in JSON format in the response's body
  51. - (nonnull NSMutableURLRequest *)requestToUri:(nonnull NSURL *)reportUri;
  52. @end