You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.1 KiB

//
// MOBFRSAHelper.h
// MOBFoundation
//
// Created by fenghj on 15/7/29.
// Copyright (c) 2015年 MOB. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MOBFRSAKey.h"
/**
* RSA加解密助手
*/
@interface MOBFRSAHelper : NSObject
/**
*
*/
@property (nonatomic, readonly) MOBFRSAKey *key;
/**
* RSA加密器
*
* @param keySize
*
* @return
*/
- (instancetype)initWithKeySize:(int)keySize;
/**
* RSA加密器
*
* @param keySize
* @param publicKey
* @param privateKey
* @param modulus
*
* @return
*/
- (instancetype)initWithKeySize:(int)keySize
publicKey:(NSString *)publicKey
privateKey:(NSString *)privateKey
modulus:(NSString *)modulus;
/**
*
*
* @param data
*
* @return
*/
- (NSData *)encryptWithData:(NSData *)data;
/**
*
*
* @param data
*
* @return
*/
- (NSData *)decryptWithData:(NSData *)data;
@end