Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 设备日志中的警告扇区[leaf AnchorTrusted]_Ios_Security - Fatal编程技术网

Ios 设备日志中的警告扇区[leaf AnchorTrusted]

Ios 设备日志中的警告扇区[leaf AnchorTrusted],ios,security,Ios,Security,我有以下检索私钥的代码 -(SecKeyRef)getKey:(NSData *)pkcs12Data { SecKeyRef privateKeyRef = nil; if(pkcs12Data ==nil || pkcs12Data.length==0) { return privateKeyRef; } NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: @

我有以下检索私钥的代码

-(SecKeyRef)getKey:(NSData *)pkcs12Data
{ 
   SecKeyRef privateKeyRef = nil;

    if(pkcs12Data ==nil || pkcs12Data.length==0)
    {
       return privateKeyRef;
    }

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: @"", kSecImportExportPassphrase, nil];
CFArrayRef items = CFArrayCreate(NULL, 0, 0, NULL);

// this line gives the warning <Error>: Nov xxxxxxx  SecTrustEvaluate  [leaf AnchorTrusted]
OSStatus returnCode = SecPKCS12Import(
                                      (__bridge CFDataRef) pkcs12Data,
                                      (__bridge CFDictionaryRef) options,
                                      & items
                                      );
if(errSecSuccess == returnCode)
{
    NSDictionary *item = (NSDictionary*) CFArrayGetValueAtIndex(items, 0);
    SecIdentityRef  identity = (__bridge SecIdentityRef) [item objectForKey:(__bridge NSString *) kSecImportItemIdentity];
    SecIdentityCopyPrivateKey(identity, &privateKeyRef);
}
else
{
    NSLog(@"failed “);
}
return privateKeyRef;
}
-(SecKeyRef)getKey:(NSData*)pkcs12Data
{ 
SecKeyRef privateKeyRef=nil;
if(pkcs12Data==nil | | pkcs12Data.length==0)
{
返回privateKeyRef;
}
NSDictionary*选项=[NSDictionary Dictionary WithObjectsAndKeys:@',kSecImportExportPassphrase,nil];
CFArrayRef items=CFArrayCreate(NULL,0,0,NULL);
//该行给出警告:11月xxxxxxx节锈评估[叶锚锈]
OSStatus returnCode=SecPKCS12Import(
(_桥CFDataRef)PKCS12数据,
(_桥CFYREF)选项,
&项目
);
if(errSecSuccess==returnCode)
{
NSDictionary*项=(NSDictionary*)CFArrayGetValueAtIndex(项,0);
SecIdentityRef identity=(u桥SecIdentityRef)[item objectForKey:(u桥NSString*)kSecImportItemIdentity];
SecIdentityCopyPrivateKey(身份和私钥参考);
}
其他的
{
NSLog(@“失败”);
}
返回privateKeyRef;
}
其中pkcs12Data是.pfx文件的数据。 虽然一切正常,但我在设备日志的SecTrustEvaluate[leaf AnchorTrusted]中收到警告。我没有任何理由这样做。请告诉我如何消除此警告