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

# SecTransformSetAttribute(_:_:_:_:)

Sets a static value for an attribute in a transform.

```
func SecTransformSetAttribute(_ transformRef: SecTransform, _ key: CFString, _ value: CFTypeRef, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>?) -> Bool
```

## Parameters

`transformRef`

The transform whose attribute is to be set.

`key`

The name of the attribute to be set. See [Transform Attributes](/documentation/Security/transform-attributes) for a list of valid keys and possible values.

`value`

The static value to set for the named attribute.

`error`

A pointer that the function uses to provide an error object with details if an error occurs. The caller becomes responsible for the object’s memory. Pass `NULL` to ignore the error.

## Return Value

A Boolean set to <doc://com.apple.documentation/documentation/Swift/true> if the call succeeds. Otherwise, the `error` parameter contains information about the failure.

## Discussion

This function is useful for things like iteration counts and other non-changing values. It returns an error and the named attribute is not changed if [`SecTransformExecute(_:_:)`](/documentation/Security/SecTransformExecute(_:_:)) has already been called on the transform.

Compare this function with the [`SecTransformConnectTransforms(_:_:_:_:_:_:)`](/documentation/Security/SecTransformConnectTransforms(_:_:_:_:_:_:)) function which sets derived data.

---

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)