1

代码(OS X Mountain Lion):

OSStatus statusNew = SecCertificateInferLabel(cert, &nameRef);

在 subj 中产生一个警告,下面你有所有包括:

#import <SecurityInterface/SFChooseIdentityPanel.h>
#include <Security/cssmtype.h>
#include <Security/oidsalg.h>
#include <Security/SecCertificate.h>
#include <Security/SecIdentity.h>
#include <Security/SecIdentitySearch.h>
#include <Security/SecPolicySearch.h>
#include <Security/SecTrust.h>
#include <Security/SecIdentitySearch.h>
#include <Security/cssmapi.h>
#include <Security/cssmapple.h>
#include <Security/cssmtype.h>
#include <Security/Security.h>

有什么建议么?

4

1 回答 1

0

尝试也包括SecCertificatePriv.h标题:

#include <Security/SecCertificatePriv.h>

我看到它包含您要使用的函数的声明。

...
/*
 * Private API to infer a display name for a SecCertificateRef which
 * may or may not be in a keychain.
 * This is a candidate for deprecation; use SecItemCopyDisplayNames() instead.
 */
OSStatus SecCertificateInferLabel(SecCertificateRef certificate, CFStringRef *label);
...
于 2012-09-19T09:52:49.977 回答