实际上我试图调用一个使用我自己的模数和指数的方法,但是我在下面给出的方法中得到了一个无效的参数异常。
- (NSData *)PublicKeyItems
{
NSString *exp = @"010001";
NSLog(@"Publickeyexp - %@",exp);
NSData *publickeyexpdata= [self stringasdata:exp];
NSLog(@"publickeyexpdata = %@",publickeyexpdata);
NSString *mod = @"008903fb6d15f352ed3b45add3216f632f7139954a5631337aba7d645ed38482e3a810b4db26aab4d1df58c147230f0c75631a3dd0554b50de44e79f4fcf205c89fd3f80e0ff8d16c2e9f56ed3ab177953d54c9c30357d04e677cedd9912906ef8a046d7b0185b7f2022a8e435b0c6ecaef93f089fc3aa3f3677550b5d842046c7";
NSLog(@"Publickeymod -%@",mod);
NSData *publickeymoddata= [self stringasdata:mod];
NSLog(@"publickeymod = %@",publickeyexpdata);
NSMutableArray *publicarray = [[[NSMutableArray alloc] init]autorelease];
[publicarray addObject:publickeyexpdata];
[publicarray addObject:publickeymoddata];
NSData *testData = [publicarray berData];
NSLog(@"testdata = %@",testData);
NSMutableArray *testArray2 = [testData berDecode];
NSLog(@"testarray = %@",testArray2);
NSData *testData2 = [testArray2 berData];
NSLog(@"PublicKeyData using Publickeyitems = %@",testData2);
return testData2;
}
我得到的例外是
“因未捕获的异常而终止应用 'NSInvalidArgumentException',原因:' - [__ NSArrayM berData]: 无法识别的选择器发送到实例0x6c49050'“
。我想公共阵列无法获得berdata。