0

我想知道有没有办法通过您的应用程序访问 MDM 服务器推送的证书?

4

1 回答 1

0

几年后 - 仍然无法访问 MDM 颁发的 X.509 证书吗?

我正在使用此代码,但结果为零。就谷歌的帮助而言,也没有办法查看是否有任何证书?

CFTypeRef   certificateRef     = NULL;                      // 1
const char *certLabelString = "XenMobile MDM";
CFStringRef certLabel = CFStringCreateWithCString(
                                                  NULL, certLabelString,
                                                  kCFStringEncodingUTF8);         
const void *keys[] =   { kSecClass, kSecAttrLabel, kSecReturnRef };
const void *values[] = { kSecClassCertificate, certLabel, kCFBooleanTrue };
CFDictionaryRef dict = CFDictionaryCreate(NULL, keys,
                                          values, 3,
                                          NULL, NULL);      
status = SecItemCopyMatching(dict, &certificateRef);        
if (status == errSecItemNotFound) {
    _UILabelINFO.text = @"error The item cannot be found (errSecItemNotFound) :";
    _UILabelINFO.text = [_UILabelINFO.text stringByAppendingString:(__bridge NSString *)(certLabel)];
} else {
    _UILabelINFO.text = @"retrieved keychain reference";
}
于 2015-08-31T12:23:14.717 回答