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

# SecCertificateGetAlgorithmID

Retrieves the algorithm identifier for a certificate.

```
OSStatus SecCertificateGetAlgorithmID(SecCertificateRef certificate, const SecAsn1AlgId **algid);
```

## Parameters

`certificate`

The certificate object from which to retrieve the algorithm identifier.

`algid`

On return, points to a struct that identifies the algorithm for this certificate. This pointer remains valid until the certificate reference is released. Do not attempt to free this pointer.

## Return Value

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

## Discussion

The `CSSM_X509_ALGORITHM_IDENTIFIER` struct is defined in `Security.framework/x509defs.h` and discussed in *Common Security: CDSA and CSSM, version 2 (with corrigenda)* from <http://www.opengroup.org/security/cdsa.htm>. Possible algorithms are enumerated in `Security.framework/oidsalg.h`.

---

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)