(xcode4.2,iossdk5.0)我正在使用SecKeyGeneratePair生成密钥,并使用SecKeyEncrypt进行加密。这两个函数都返回OSStatus 0。
但是在使用SecKeyDecrypt进行解密时,我得到了OSStatus as -9809。请帮帮忙,我哪里搞错了?
编辑:感谢您的快速响应。我从下面的链接复制并粘贴了代码:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/17242-rsa-generating-keypair-so-slowly.html
发布于 2013-06-16 01:32:47
原因是Apple page上有一个打字错误
NSData *encryptedData = [NSData dataWithBytes:cipherBuffer length:dataLength];它应该是:
NSData *encryptedData = [NSData dataWithBytes:cipherBuffer length:cipherBufferSize];https://stackoverflow.com/questions/8046776
复制相似问题