LKLicenseWindowController.h

This file can be downloaded as part of milnlicence.tbz.

//
//  LKLicenseWindowController.h
//  LicenceKit - https://indie.miln.eu
//
//  Copyright © Graham Miln. All rights reserved. https://miln.eu
//
//  This package is subject to the terms of the Artistic License 2.0.
//  If a copy of the Artistic-2.0 was not distributed with this file, you can
//  obtain one at https://indie.miln.eu/licence


// Info.plist keys
extern NSString* LKLicenceKitInfoPListKeyTrusted; /**< Info.plist "LKTrusted" : An array of trusted certificate names embedded in application bundle; optional, see LKLicenceKit's trustedPEMs */
extern NSString* LKLicenceKitInfoPListKeyStoreURL; /**< Info.plist "LKStoreURL" : A string containing a store URL where the user can purchase licences. */
extern NSString* LKLicenceKitInfoPListKeyFileTypes; /**< Info.plist "LKFileTypes" : An array of licence file types. */

// UTIs and file extensions
extern NSString* LKLicenceKitUTIX509Certificate; /**< Universal Type Identifier (UTI) for X.509 certificate. */
extern NSString* LKLicenceKitPEMFileExtension; /**< Privacy Enhanced Mail (PEM) file extension. */

/** Licensing user interface. */
@interface LKLicenseWindowController : NSWindowController
@property(strong,readonly) LCLicenceCore* core; /** Shared licence core. */
// ...
@property(strong,readonly) NSURL* storeURL; /** A URL showing the purchasing options. */
@property(strong,readonly) NSArray<NSString*>* allowedFileTypes; /** File types containing licence information. */
// ...
@property(copy,readwrite) NSArray<NSData*>* trustedPEMs; /** PEM encoded anchor certificates to evaluate against; optional. If nil or empty, LCLicenceCoreInfoPListKeyAnchors will be used. */

/** Return a shared licence window. */
+ (LKLicenseWindowController*)sharedLicenseWindow;

/** Present an open panel for adding licence files. */
- (IBAction)addLicence:(id)aSender;

/** Present a confirmation alert before removing all known licences. */
- (IBAction)removeLicences:(id)aSender;

/** Open the licence store URL in the default browser. */
- (IBAction)buyLicence:(id)aSender;

@end