//
//  WSDecryption.h
//  SDK212
//
//  Created by woosimsystems on 2016. 7. 04..
//  Copyright © 2016년 woosimsystems. All rights reserved.
//

#import <Foundation/Foundation.h>

#define BASEKEY_INDEX       0x1000
#define BASEKEY_SUCCESS     0x1001
#define BASEKEY_FAIL        0x1002
#define ENCRYPTED_DATA       0x1003


typedef enum {
    ENCRYPTION_WOOSIM_3DES = 0,
    ENCRYPTION_3DES,
    ENCRYPTION_WOOSIM_AES128,
    ENCRYPTION_AES128,
    ENCRYPTION_WOOSIM_AES192,
    ENCRYPTION_AES192,
    ENCRYPTION_WOOSIM_AES256,
    ENCRYPTION_AES256
} ENCRYPTION;


@interface WSDecryption : NSObject
- (Boolean)decryptData:(NSData*)encryptedData byEncryptionMode:(ENCRYPTION)mode withBaseKey:(NSString*)key;
- (NSData *)getIndex;
- (NSData *)enterEncryptedMSR1stTrackMode;
- (NSData *)enterEncryptedMSR2ndTrackMode;
- (NSData *)enterEncryptedMSR3rdTrackMode;
- (NSData *)enterEncryptedMSRDoubleTrackMode;
- (NSData *)enterEncryptedMSRTripleTrackMode;
- (NSData *)selectEncryptionMode:(ENCRYPTION)mode;

//사용 시 주의
- (NSData *)setBaseKeyList:(NSString *)list count:(uint8_t)count;
- (NSData *)setIndexOfBaseKey:(uint8_t)index;

@property (nonatomic, readonly) NSData *decryptedTrack1;
@property (nonatomic, readonly) NSData *decryptedTrack2;
@property (nonatomic, readonly) NSData *decryptedTrack3;

@end

