<!--
{
  "availability" : [
    "macOS: 10.2.0 - 10.7.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecPolicyGetOID",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecPolicyGetOID"
  },
  "title" : "SecPolicyGetOID"
}
-->

# SecPolicyGetOID

Retrieves a policy’s object identifier.

```
OSStatus SecPolicyGetOID(SecPolicyRef policyRef, SecAsn1Oid *oid);
```

## Parameters

`policyRef`

The policy object for which to obtain the object identifier. You can obtain a policy object with the [`SecPolicySearchCopyNext`](/documentation/Security/SecPolicySearchCopyNext) function.

`oid`

On return, points to the policy’s object identifier. This identifier is owned by the policy object and remains valid until that object is destroyed; do not release it separately.

## Return Value

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes).

## Discussion

The policy’s object identifier, in the form of a `CSSM_OID` structure, is used in the CSSM API together with the policy’s value. Use the [`SecPolicyGetValue`](/documentation/Security/SecPolicyGetValue) function to obtain the value that corresponds to this object identifier.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)