Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8260157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:01:58+00:00 2026-06-08T03:01:58+00:00

In a simple methods to delete Certs by CN (the certs have previously been

  • 0

In a simple methods to delete Certs by CN (the certs have previously been put there by SecItemAdd from a PKCS12 import); I am getting the error:

Property list invalid for format: 200 (property lists cannot contain objects of type ‘SecIdentity’)

Where based on https://developer.apple.com/documentation/security/1395547-secitemdelete I think I am following the instruction:

To delete an item identified by a transient reference, specify the
kSecMatchItemList search key with a reference returned by using the
kSecReturnRef return type key in a previous call to the
SecItemCopyMatching or SecItemAdd functions.

to the letter. Code below:

NSDictionary * attributes;
NSString * cnString = @"/CN=foo";

attributes = [NSDictionary dictionaryWithObjectsAndKeys:
              (__bridge id)(kSecClassIdentity), kSecClass,
              cnString, kSecMatchSubjectContains,
              kSecMatchLimitAll, kSecMatchLimit,
              kCFBooleanTrue, kSecReturnRef,
              nil];

CFArrayRef result;
status = SecItemCopyMatching((__bridge CFDictionaryRef)(attributes), 
      (CFTypeRef *)&result);

if (status == noErr) {

    for(int i = 0; i < CFArrayGetCount(result); i++) {

        SecIdentityRef item = (SecIdentityRef) CFArrayGetValueAtIndex(result, i);
        NSLog(@"Item #%d: %@", i, item);

        attributes = [NSDictionary dictionaryWithObjectsAndKeys:
                      (__bridge id)(kSecClassIdentity), kSecClass,
                      [NSArray arrayWithObject:(__bridge id)item], kSecMatchItemList,
                      kSecMatchLimitOne, kSecMatchLimit,
                      nil];

        status = SecItemDelete((__bridge CFDictionaryRef)(attributes));

        if (status != noErr || status != errSecItemNotFound)
            NSLog(@"Delete %d/%@failed: %ld (ignored)", i,item, status);
    };
};

The output on the console is:

 Item #0: <SecIdentityRef: 0xc7359ff0>

straight after the find (and if the search is widened we get an array of these).

And then from deep inside Security.dylib:

Property list invalid for format: 200 (property lists cannot contain objects of type ‘SecIdentity’)

To ultimately bail with:

 Delete 0/<SecIdentityRef: 0xc7359ff0>failed: -50 (ignored)

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:02:00+00:00Added an answer on June 8, 2026 at 3:02 am

    This has been fixed in the latest GM drop. Reality is now in sync with the documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used django-tastypie using GET,POST,PUT,DELETE methods , they are working smoothly when both
I have this simple Delete Get and Post methods in a asp.net mvc application
I writing a simple method which should delete an entity from the database if
I have the following simple methods for writing a python object to a file
I have a simple marker annotation for methods (similar to the first example in
I have the following methods in my simple Custom Parser Class, when I execute
I have a simple Java class that has some methods: public class Utils {
I have a very simple yes no question: should static methods have same result
Is there library usable from c++ for sharing fairly simple data (integers,floating point numbers,
A simple scenario: I want to delete a pagelayout that is out-dated from our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.