/***********************************************************************
  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 SecurePDFPDFEncryptDelegate <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 SecurePDFPDFEncrypt : NSObject {
  @public void* m_pObj;
  @public CFMutableArrayRef m_rNotifiers;
  __unsafe_unretained id <SecurePDFPDFEncryptDelegate> m_delegate;
  BOOL m_raiseNSException;
  BOOL m_delegateHasError;

  BOOL m_delegateHasLog;

  BOOL m_delegateHasPassword;

  BOOL m_delegateHasRecipientInfo;

}

+ (SecurePDFPDFEncrypt*)pdfencrypt;

- (id)init;
- (void)dealloc;

- (NSString*)lastError;
- (int)lastErrorCode;
- (int)eventErrorCode;

@property (nonatomic,readwrite,assign,getter=delegate,setter=setDelegate:) id <SecurePDFPDFEncryptDelegate> delegate;
- (id <SecurePDFPDFEncryptDelegate>)delegate;
- (void) setDelegate:(id <SecurePDFPDFEncryptDelegate>)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,readwrite,assign,getter=encryptionAlgorithm,setter=setEncryptionAlgorithm:) NSString* encryptionAlgorithm NS_SWIFT_NAME(encryptionAlgorithm);

- (NSString*)encryptionAlgorithm NS_SWIFT_NAME(encryptionAlgorithm());
- (void)setEncryptionAlgorithm :(NSString*)newEncryptionAlgorithm NS_SWIFT_NAME(setEncryptionAlgorithm(_:));

@property (nonatomic,readonly,assign,getter=encryptionCertEffectiveDate) NSString* encryptionCertEffectiveDate NS_SWIFT_NAME(encryptionCertEffectiveDate);

- (NSString*)encryptionCertEffectiveDate NS_SWIFT_NAME(encryptionCertEffectiveDate());

@property (nonatomic,readonly,assign,getter=encryptionCertExpirationDate) NSString* encryptionCertExpirationDate NS_SWIFT_NAME(encryptionCertExpirationDate);

- (NSString*)encryptionCertExpirationDate NS_SWIFT_NAME(encryptionCertExpirationDate());

@property (nonatomic,readonly,assign,getter=encryptionCertExtendedKeyUsage) NSString* encryptionCertExtendedKeyUsage NS_SWIFT_NAME(encryptionCertExtendedKeyUsage);

- (NSString*)encryptionCertExtendedKeyUsage NS_SWIFT_NAME(encryptionCertExtendedKeyUsage());

@property (nonatomic,readonly,assign,getter=encryptionCertFingerprint) NSString* encryptionCertFingerprint NS_SWIFT_NAME(encryptionCertFingerprint);

- (NSString*)encryptionCertFingerprint NS_SWIFT_NAME(encryptionCertFingerprint());

@property (nonatomic,readonly,assign,getter=encryptionCertFingerprintSHA1) NSString* encryptionCertFingerprintSHA1 NS_SWIFT_NAME(encryptionCertFingerprintSHA1);

- (NSString*)encryptionCertFingerprintSHA1 NS_SWIFT_NAME(encryptionCertFingerprintSHA1());

@property (nonatomic,readonly,assign,getter=encryptionCertFingerprintSHA256) NSString* encryptionCertFingerprintSHA256 NS_SWIFT_NAME(encryptionCertFingerprintSHA256);

- (NSString*)encryptionCertFingerprintSHA256 NS_SWIFT_NAME(encryptionCertFingerprintSHA256());

@property (nonatomic,readonly,assign,getter=encryptionCertIssuer) NSString* encryptionCertIssuer NS_SWIFT_NAME(encryptionCertIssuer);

- (NSString*)encryptionCertIssuer NS_SWIFT_NAME(encryptionCertIssuer());

@property (nonatomic,readonly,assign,getter=encryptionCertPrivateKey) NSString* encryptionCertPrivateKey NS_SWIFT_NAME(encryptionCertPrivateKey);

- (NSString*)encryptionCertPrivateKey NS_SWIFT_NAME(encryptionCertPrivateKey());

@property (nonatomic,readonly,assign,getter=encryptionCertPrivateKeyAvailable) BOOL encryptionCertPrivateKeyAvailable NS_SWIFT_NAME(encryptionCertPrivateKeyAvailable);

- (BOOL)encryptionCertPrivateKeyAvailable NS_SWIFT_NAME(encryptionCertPrivateKeyAvailable());

@property (nonatomic,readonly,assign,getter=encryptionCertPrivateKeyContainer) NSString* encryptionCertPrivateKeyContainer NS_SWIFT_NAME(encryptionCertPrivateKeyContainer);

- (NSString*)encryptionCertPrivateKeyContainer NS_SWIFT_NAME(encryptionCertPrivateKeyContainer());

@property (nonatomic,readonly,assign,getter=encryptionCertPublicKey) NSString* encryptionCertPublicKey NS_SWIFT_NAME(encryptionCertPublicKey);

- (NSString*)encryptionCertPublicKey NS_SWIFT_NAME(encryptionCertPublicKey());

@property (nonatomic,readonly,assign,getter=encryptionCertPublicKeyAlgorithm) NSString* encryptionCertPublicKeyAlgorithm NS_SWIFT_NAME(encryptionCertPublicKeyAlgorithm);

- (NSString*)encryptionCertPublicKeyAlgorithm NS_SWIFT_NAME(encryptionCertPublicKeyAlgorithm());

@property (nonatomic,readonly,assign,getter=encryptionCertPublicKeyLength) int encryptionCertPublicKeyLength NS_SWIFT_NAME(encryptionCertPublicKeyLength);

- (int)encryptionCertPublicKeyLength NS_SWIFT_NAME(encryptionCertPublicKeyLength());

@property (nonatomic,readonly,assign,getter=encryptionCertSerialNumber) NSString* encryptionCertSerialNumber NS_SWIFT_NAME(encryptionCertSerialNumber);

- (NSString*)encryptionCertSerialNumber NS_SWIFT_NAME(encryptionCertSerialNumber());

@property (nonatomic,readonly,assign,getter=encryptionCertSignatureAlgorithm) NSString* encryptionCertSignatureAlgorithm NS_SWIFT_NAME(encryptionCertSignatureAlgorithm);

- (NSString*)encryptionCertSignatureAlgorithm NS_SWIFT_NAME(encryptionCertSignatureAlgorithm());

@property (nonatomic,readwrite,assign,getter=encryptionCertStore,setter=setEncryptionCertStore:) NSString* encryptionCertStore NS_SWIFT_NAME(encryptionCertStore);

- (NSString*)encryptionCertStore NS_SWIFT_NAME(encryptionCertStore());
- (void)setEncryptionCertStore :(NSString*)newEncryptionCertStore NS_SWIFT_NAME(setEncryptionCertStore(_:));

@property (nonatomic,readwrite,assign,getter=encryptionCertStoreB,setter=setEncryptionCertStoreB:) NSData* encryptionCertStoreB NS_SWIFT_NAME(encryptionCertStoreB);

- (NSData*)encryptionCertStoreB NS_SWIFT_NAME(encryptionCertStoreB());
- (void)setEncryptionCertStoreB :(NSData*)newEncryptionCertStore NS_SWIFT_NAME(setEncryptionCertStoreB(_:));


@property (nonatomic,readwrite,assign,getter=encryptionCertStorePassword,setter=setEncryptionCertStorePassword:) NSString* encryptionCertStorePassword NS_SWIFT_NAME(encryptionCertStorePassword);

- (NSString*)encryptionCertStorePassword NS_SWIFT_NAME(encryptionCertStorePassword());
- (void)setEncryptionCertStorePassword :(NSString*)newEncryptionCertStorePassword NS_SWIFT_NAME(setEncryptionCertStorePassword(_:));

@property (nonatomic,readwrite,assign,getter=encryptionCertStoreType,setter=setEncryptionCertStoreType:) int encryptionCertStoreType NS_SWIFT_NAME(encryptionCertStoreType);

- (int)encryptionCertStoreType NS_SWIFT_NAME(encryptionCertStoreType());
- (void)setEncryptionCertStoreType :(int)newEncryptionCertStoreType NS_SWIFT_NAME(setEncryptionCertStoreType(_:));

@property (nonatomic,readonly,assign,getter=encryptionCertSubjectAltNames) NSString* encryptionCertSubjectAltNames NS_SWIFT_NAME(encryptionCertSubjectAltNames);

- (NSString*)encryptionCertSubjectAltNames NS_SWIFT_NAME(encryptionCertSubjectAltNames());

@property (nonatomic,readonly,assign,getter=encryptionCertThumbprintMD5) NSString* encryptionCertThumbprintMD5 NS_SWIFT_NAME(encryptionCertThumbprintMD5);

- (NSString*)encryptionCertThumbprintMD5 NS_SWIFT_NAME(encryptionCertThumbprintMD5());

@property (nonatomic,readonly,assign,getter=encryptionCertThumbprintSHA1) NSString* encryptionCertThumbprintSHA1 NS_SWIFT_NAME(encryptionCertThumbprintSHA1);

- (NSString*)encryptionCertThumbprintSHA1 NS_SWIFT_NAME(encryptionCertThumbprintSHA1());

@property (nonatomic,readonly,assign,getter=encryptionCertThumbprintSHA256) NSString* encryptionCertThumbprintSHA256 NS_SWIFT_NAME(encryptionCertThumbprintSHA256);

- (NSString*)encryptionCertThumbprintSHA256 NS_SWIFT_NAME(encryptionCertThumbprintSHA256());

@property (nonatomic,readonly,assign,getter=encryptionCertUsage) NSString* encryptionCertUsage NS_SWIFT_NAME(encryptionCertUsage);

- (NSString*)encryptionCertUsage NS_SWIFT_NAME(encryptionCertUsage());

@property (nonatomic,readonly,assign,getter=encryptionCertUsageFlags) int encryptionCertUsageFlags NS_SWIFT_NAME(encryptionCertUsageFlags);

- (int)encryptionCertUsageFlags NS_SWIFT_NAME(encryptionCertUsageFlags());

@property (nonatomic,readonly,assign,getter=encryptionCertVersion) NSString* encryptionCertVersion NS_SWIFT_NAME(encryptionCertVersion);

- (NSString*)encryptionCertVersion NS_SWIFT_NAME(encryptionCertVersion());

@property (nonatomic,readwrite,assign,getter=encryptionCertSubject,setter=setEncryptionCertSubject:) NSString* encryptionCertSubject NS_SWIFT_NAME(encryptionCertSubject);

- (NSString*)encryptionCertSubject NS_SWIFT_NAME(encryptionCertSubject());
- (void)setEncryptionCertSubject :(NSString*)newEncryptionCertSubject NS_SWIFT_NAME(setEncryptionCertSubject(_:));

@property (nonatomic,readwrite,assign,getter=encryptionCertEncoded,setter=setEncryptionCertEncoded:) NSString* encryptionCertEncoded NS_SWIFT_NAME(encryptionCertEncoded);

- (NSString*)encryptionCertEncoded NS_SWIFT_NAME(encryptionCertEncoded());
- (void)setEncryptionCertEncoded :(NSString*)newEncryptionCertEncoded NS_SWIFT_NAME(setEncryptionCertEncoded(_:));

@property (nonatomic,readwrite,assign,getter=encryptionCertEncodedB,setter=setEncryptionCertEncodedB:) NSData* encryptionCertEncodedB NS_SWIFT_NAME(encryptionCertEncodedB);

- (NSData*)encryptionCertEncodedB NS_SWIFT_NAME(encryptionCertEncodedB());
- (void)setEncryptionCertEncodedB :(NSData*)newEncryptionCertEncoded NS_SWIFT_NAME(setEncryptionCertEncodedB(_:));


@property (nonatomic,readwrite,assign,getter=encryptMetadata,setter=setEncryptMetadata:) BOOL encryptMetadata NS_SWIFT_NAME(encryptMetadata);

- (BOOL)encryptMetadata NS_SWIFT_NAME(encryptMetadata());
- (void)setEncryptMetadata :(BOOL)newEncryptMetadata NS_SWIFT_NAME(setEncryptMetadata(_:));

@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(_:));

@property (nonatomic,readwrite,assign,getter=permissions,setter=setPermissions:) int permissions NS_SWIFT_NAME(permissions);

- (int)permissions NS_SWIFT_NAME(permissions());
- (void)setPermissions :(int)newPermissions NS_SWIFT_NAME(setPermissions(_:));

  /* Methods */

- (void)close NS_SWIFT_NAME(close());

- (NSString*)config:(NSString*)configurationString NS_SWIFT_NAME(config(_:));

- (void)encrypt NS_SWIFT_NAME(encrypt());

- (BOOL)encrypted NS_SWIFT_NAME(encrypted());

- (void)open NS_SWIFT_NAME(open());

- (void)reset NS_SWIFT_NAME(reset());

@end

