/***********************************************************************
  Secure PDF 2024 for macOS and iOS
  Copyright (c) 2026 /n software inc.
************************************************************************/

#import <Foundation/Foundation.h>


//CERTSTORETYPES
#define CST_USER                                           0

#define CST_MACHINE                                        1

#define CST_PFXFILE                                        2

#define CST_PFXBLOB                                        3

#define CST_JKSFILE                                        4

#define CST_JKSBLOB                                        5

#define CST_PEMKEY_FILE                                    6

#define CST_PEMKEY_BLOB                                    7

#define CST_PUBLIC_KEY_FILE                                8

#define CST_PUBLIC_KEY_BLOB                                9

#define CST_SSHPUBLIC_KEY_BLOB                             10

#define CST_P7BFILE                                        11

#define CST_P7BBLOB                                        12

#define CST_SSHPUBLIC_KEY_FILE                             13

#define CST_PPKFILE                                        14

#define CST_PPKBLOB                                        15

#define CST_XMLFILE                                        16

#define CST_XMLBLOB                                        17

#define CST_JWKFILE                                        18

#define CST_JWKBLOB                                        19

#define CST_SECURITY_KEY                                   20

#define CST_BCFKSFILE                                      21

#define CST_BCFKSBLOB                                      22

#define CST_PKCS11                                         23

#define CST_AUTO                                           99

#ifndef NS_SWIFT_NAME
#define NS_SWIFT_NAME(x)
#endif

@protocol SecurePDFPDFDecryptDelegate <NSObject>
@optional
- (void)onError:(int)errorCode :(NSString*)description NS_SWIFT_NAME(onError(_:_:));

- (void)onLog:(int)logLevel :(NSString*)message :(NSString*)logType NS_SWIFT_NAME(onLog(_:_:_:));

- (void)onPassword:(BOOL)available :(int*)cancel NS_SWIFT_NAME(onPassword(_:_:));

- (void)onRecipientInfo:(NSString*)issuer :(NSString*)serialNumber :(NSString*)subjectKeyIdentifier :(BOOL)available :(int*)cancel NS_SWIFT_NAME(onRecipientInfo(_:_:_:_:_:));

@end

@interface SecurePDFPDFDecrypt : NSObject {
  @public void* m_pObj;
  @public CFMutableArrayRef m_rNotifiers;
  __unsafe_unretained id <SecurePDFPDFDecryptDelegate> m_delegate;
  BOOL m_raiseNSException;
  BOOL m_delegateHasError;

  BOOL m_delegateHasLog;

  BOOL m_delegateHasPassword;

  BOOL m_delegateHasRecipientInfo;

}

+ (SecurePDFPDFDecrypt*)pdfdecrypt;

- (id)init;
- (void)dealloc;

- (NSString*)lastError;
- (int)lastErrorCode;
- (int)eventErrorCode;

@property (nonatomic,readwrite,assign,getter=delegate,setter=setDelegate:) id <SecurePDFPDFDecryptDelegate> delegate;
- (id <SecurePDFPDFDecryptDelegate>)delegate;
- (void) setDelegate:(id <SecurePDFPDFDecryptDelegate>)anObject;

  /* Events */

- (void)onError:(int)errorCode :(NSString*)description NS_SWIFT_NAME(onError(_:_:));

- (void)onLog:(int)logLevel :(NSString*)message :(NSString*)logType NS_SWIFT_NAME(onLog(_:_:_:));

- (void)onPassword:(BOOL)available :(int*)cancel NS_SWIFT_NAME(onPassword(_:_:));

- (void)onRecipientInfo:(NSString*)issuer :(NSString*)serialNumber :(NSString*)subjectKeyIdentifier :(BOOL)available :(int*)cancel NS_SWIFT_NAME(onRecipientInfo(_:_:_:_:_:));

  /* Properties */

@property (nonatomic,readwrite,assign,getter=RuntimeLicense,setter=setRuntimeLicense:) NSString* RuntimeLicense NS_SWIFT_NAME(RuntimeLicense);
- (NSString*)RuntimeLicense;
- (void)setRuntimeLicense:(NSString*)newRuntimeLicense;

@property (nonatomic,readonly,assign,getter=VERSION) NSString* VERSION NS_SWIFT_NAME(VERSION);
- (NSString*)VERSION;

@property (nonatomic,readwrite,assign,getter=raiseNSException,setter=setRaiseNSException:) BOOL raiseNSException NS_SWIFT_NAME(raiseNSException);
- (BOOL)raiseNSException NS_SWIFT_NAME(raiseNSException());
- (void)setRaiseNSException:(BOOL)newRaiseNSException NS_SWIFT_NAME(setRaiseNSException(_:));

@property (nonatomic,readonly,assign,getter=decryptionCertEffectiveDate) NSString* decryptionCertEffectiveDate NS_SWIFT_NAME(decryptionCertEffectiveDate);

- (NSString*)decryptionCertEffectiveDate NS_SWIFT_NAME(decryptionCertEffectiveDate());

@property (nonatomic,readonly,assign,getter=decryptionCertExpirationDate) NSString* decryptionCertExpirationDate NS_SWIFT_NAME(decryptionCertExpirationDate);

- (NSString*)decryptionCertExpirationDate NS_SWIFT_NAME(decryptionCertExpirationDate());

@property (nonatomic,readonly,assign,getter=decryptionCertExtendedKeyUsage) NSString* decryptionCertExtendedKeyUsage NS_SWIFT_NAME(decryptionCertExtendedKeyUsage);

- (NSString*)decryptionCertExtendedKeyUsage NS_SWIFT_NAME(decryptionCertExtendedKeyUsage());

@property (nonatomic,readonly,assign,getter=decryptionCertFingerprint) NSString* decryptionCertFingerprint NS_SWIFT_NAME(decryptionCertFingerprint);

- (NSString*)decryptionCertFingerprint NS_SWIFT_NAME(decryptionCertFingerprint());

@property (nonatomic,readonly,assign,getter=decryptionCertFingerprintSHA1) NSString* decryptionCertFingerprintSHA1 NS_SWIFT_NAME(decryptionCertFingerprintSHA1);

- (NSString*)decryptionCertFingerprintSHA1 NS_SWIFT_NAME(decryptionCertFingerprintSHA1());

@property (nonatomic,readonly,assign,getter=decryptionCertFingerprintSHA256) NSString* decryptionCertFingerprintSHA256 NS_SWIFT_NAME(decryptionCertFingerprintSHA256);

- (NSString*)decryptionCertFingerprintSHA256 NS_SWIFT_NAME(decryptionCertFingerprintSHA256());

@property (nonatomic,readonly,assign,getter=decryptionCertIssuer) NSString* decryptionCertIssuer NS_SWIFT_NAME(decryptionCertIssuer);

- (NSString*)decryptionCertIssuer NS_SWIFT_NAME(decryptionCertIssuer());

@property (nonatomic,readonly,assign,getter=decryptionCertPrivateKey) NSString* decryptionCertPrivateKey NS_SWIFT_NAME(decryptionCertPrivateKey);

- (NSString*)decryptionCertPrivateKey NS_SWIFT_NAME(decryptionCertPrivateKey());

@property (nonatomic,readonly,assign,getter=decryptionCertPrivateKeyAvailable) BOOL decryptionCertPrivateKeyAvailable NS_SWIFT_NAME(decryptionCertPrivateKeyAvailable);

- (BOOL)decryptionCertPrivateKeyAvailable NS_SWIFT_NAME(decryptionCertPrivateKeyAvailable());

@property (nonatomic,readonly,assign,getter=decryptionCertPrivateKeyContainer) NSString* decryptionCertPrivateKeyContainer NS_SWIFT_NAME(decryptionCertPrivateKeyContainer);

- (NSString*)decryptionCertPrivateKeyContainer NS_SWIFT_NAME(decryptionCertPrivateKeyContainer());

@property (nonatomic,readonly,assign,getter=decryptionCertPublicKey) NSString* decryptionCertPublicKey NS_SWIFT_NAME(decryptionCertPublicKey);

- (NSString*)decryptionCertPublicKey NS_SWIFT_NAME(decryptionCertPublicKey());

@property (nonatomic,readonly,assign,getter=decryptionCertPublicKeyAlgorithm) NSString* decryptionCertPublicKeyAlgorithm NS_SWIFT_NAME(decryptionCertPublicKeyAlgorithm);

- (NSString*)decryptionCertPublicKeyAlgorithm NS_SWIFT_NAME(decryptionCertPublicKeyAlgorithm());

@property (nonatomic,readonly,assign,getter=decryptionCertPublicKeyLength) int decryptionCertPublicKeyLength NS_SWIFT_NAME(decryptionCertPublicKeyLength);

- (int)decryptionCertPublicKeyLength NS_SWIFT_NAME(decryptionCertPublicKeyLength());

@property (nonatomic,readonly,assign,getter=decryptionCertSerialNumber) NSString* decryptionCertSerialNumber NS_SWIFT_NAME(decryptionCertSerialNumber);

- (NSString*)decryptionCertSerialNumber NS_SWIFT_NAME(decryptionCertSerialNumber());

@property (nonatomic,readonly,assign,getter=decryptionCertSignatureAlgorithm) NSString* decryptionCertSignatureAlgorithm NS_SWIFT_NAME(decryptionCertSignatureAlgorithm);

- (NSString*)decryptionCertSignatureAlgorithm NS_SWIFT_NAME(decryptionCertSignatureAlgorithm());

@property (nonatomic,readwrite,assign,getter=decryptionCertStore,setter=setDecryptionCertStore:) NSString* decryptionCertStore NS_SWIFT_NAME(decryptionCertStore);

- (NSString*)decryptionCertStore NS_SWIFT_NAME(decryptionCertStore());
- (void)setDecryptionCertStore :(NSString*)newDecryptionCertStore NS_SWIFT_NAME(setDecryptionCertStore(_:));

@property (nonatomic,readwrite,assign,getter=decryptionCertStoreB,setter=setDecryptionCertStoreB:) NSData* decryptionCertStoreB NS_SWIFT_NAME(decryptionCertStoreB);

- (NSData*)decryptionCertStoreB NS_SWIFT_NAME(decryptionCertStoreB());
- (void)setDecryptionCertStoreB :(NSData*)newDecryptionCertStore NS_SWIFT_NAME(setDecryptionCertStoreB(_:));


@property (nonatomic,readwrite,assign,getter=decryptionCertStorePassword,setter=setDecryptionCertStorePassword:) NSString* decryptionCertStorePassword NS_SWIFT_NAME(decryptionCertStorePassword);

- (NSString*)decryptionCertStorePassword NS_SWIFT_NAME(decryptionCertStorePassword());
- (void)setDecryptionCertStorePassword :(NSString*)newDecryptionCertStorePassword NS_SWIFT_NAME(setDecryptionCertStorePassword(_:));

@property (nonatomic,readwrite,assign,getter=decryptionCertStoreType,setter=setDecryptionCertStoreType:) int decryptionCertStoreType NS_SWIFT_NAME(decryptionCertStoreType);

- (int)decryptionCertStoreType NS_SWIFT_NAME(decryptionCertStoreType());
- (void)setDecryptionCertStoreType :(int)newDecryptionCertStoreType NS_SWIFT_NAME(setDecryptionCertStoreType(_:));

@property (nonatomic,readonly,assign,getter=decryptionCertSubjectAltNames) NSString* decryptionCertSubjectAltNames NS_SWIFT_NAME(decryptionCertSubjectAltNames);

- (NSString*)decryptionCertSubjectAltNames NS_SWIFT_NAME(decryptionCertSubjectAltNames());

@property (nonatomic,readonly,assign,getter=decryptionCertThumbprintMD5) NSString* decryptionCertThumbprintMD5 NS_SWIFT_NAME(decryptionCertThumbprintMD5);

- (NSString*)decryptionCertThumbprintMD5 NS_SWIFT_NAME(decryptionCertThumbprintMD5());

@property (nonatomic,readonly,assign,getter=decryptionCertThumbprintSHA1) NSString* decryptionCertThumbprintSHA1 NS_SWIFT_NAME(decryptionCertThumbprintSHA1);

- (NSString*)decryptionCertThumbprintSHA1 NS_SWIFT_NAME(decryptionCertThumbprintSHA1());

@property (nonatomic,readonly,assign,getter=decryptionCertThumbprintSHA256) NSString* decryptionCertThumbprintSHA256 NS_SWIFT_NAME(decryptionCertThumbprintSHA256);

- (NSString*)decryptionCertThumbprintSHA256 NS_SWIFT_NAME(decryptionCertThumbprintSHA256());

@property (nonatomic,readonly,assign,getter=decryptionCertUsage) NSString* decryptionCertUsage NS_SWIFT_NAME(decryptionCertUsage);

- (NSString*)decryptionCertUsage NS_SWIFT_NAME(decryptionCertUsage());

@property (nonatomic,readonly,assign,getter=decryptionCertUsageFlags) int decryptionCertUsageFlags NS_SWIFT_NAME(decryptionCertUsageFlags);

- (int)decryptionCertUsageFlags NS_SWIFT_NAME(decryptionCertUsageFlags());

@property (nonatomic,readonly,assign,getter=decryptionCertVersion) NSString* decryptionCertVersion NS_SWIFT_NAME(decryptionCertVersion);

- (NSString*)decryptionCertVersion NS_SWIFT_NAME(decryptionCertVersion());

@property (nonatomic,readwrite,assign,getter=decryptionCertSubject,setter=setDecryptionCertSubject:) NSString* decryptionCertSubject NS_SWIFT_NAME(decryptionCertSubject);

- (NSString*)decryptionCertSubject NS_SWIFT_NAME(decryptionCertSubject());
- (void)setDecryptionCertSubject :(NSString*)newDecryptionCertSubject NS_SWIFT_NAME(setDecryptionCertSubject(_:));

@property (nonatomic,readwrite,assign,getter=decryptionCertEncoded,setter=setDecryptionCertEncoded:) NSString* decryptionCertEncoded NS_SWIFT_NAME(decryptionCertEncoded);

- (NSString*)decryptionCertEncoded NS_SWIFT_NAME(decryptionCertEncoded());
- (void)setDecryptionCertEncoded :(NSString*)newDecryptionCertEncoded NS_SWIFT_NAME(setDecryptionCertEncoded(_:));

@property (nonatomic,readwrite,assign,getter=decryptionCertEncodedB,setter=setDecryptionCertEncodedB:) NSData* decryptionCertEncodedB NS_SWIFT_NAME(decryptionCertEncodedB);

- (NSData*)decryptionCertEncodedB NS_SWIFT_NAME(decryptionCertEncodedB());
- (void)setDecryptionCertEncodedB :(NSData*)newDecryptionCertEncoded NS_SWIFT_NAME(setDecryptionCertEncodedB(_:));


@property (nonatomic,readwrite,assign,getter=inputData,setter=setInputData:) NSData* inputData NS_SWIFT_NAME(inputData);

- (NSData*)inputData NS_SWIFT_NAME(inputData());
- (void)setInputData :(NSData*)newInputData NS_SWIFT_NAME(setInputData(_:));

@property (nonatomic,readwrite,assign,getter=inputFile,setter=setInputFile:) NSString* inputFile NS_SWIFT_NAME(inputFile);

- (NSString*)inputFile NS_SWIFT_NAME(inputFile());
- (void)setInputFile :(NSString*)newInputFile NS_SWIFT_NAME(setInputFile(_:));

@property (nonatomic,readonly,assign,getter=outputData) NSData* outputData NS_SWIFT_NAME(outputData);

- (NSData*)outputData NS_SWIFT_NAME(outputData());

@property (nonatomic,readwrite,assign,getter=outputFile,setter=setOutputFile:) NSString* outputFile NS_SWIFT_NAME(outputFile);

- (NSString*)outputFile NS_SWIFT_NAME(outputFile());
- (void)setOutputFile :(NSString*)newOutputFile NS_SWIFT_NAME(setOutputFile(_:));

@property (nonatomic,readwrite,assign,getter=overwrite,setter=setOverwrite:) BOOL overwrite NS_SWIFT_NAME(overwrite);

- (BOOL)overwrite NS_SWIFT_NAME(overwrite());
- (void)setOverwrite :(BOOL)newOverwrite NS_SWIFT_NAME(setOverwrite(_:));

@property (nonatomic,readwrite,assign,getter=password,setter=setPassword:) NSString* password NS_SWIFT_NAME(password);

- (NSString*)password NS_SWIFT_NAME(password());
- (void)setPassword :(NSString*)newPassword NS_SWIFT_NAME(setPassword(_:));

  /* Methods */

- (void)close NS_SWIFT_NAME(close());

- (NSString*)config:(NSString*)configurationString NS_SWIFT_NAME(config(_:));

- (void)decrypt NS_SWIFT_NAME(decrypt());

- (BOOL)encrypted NS_SWIFT_NAME(encrypted());

- (void)open NS_SWIFT_NAME(open());

- (void)reset NS_SWIFT_NAME(reset());

@end

