+/*
+ * Set the hash agility attribute for a CMSEncoder.
+ * This is only used if the kCMSAttrAppleCodesigningHashAgility attribute
+ * is included.
+ */
+OSStatus CMSEncoderSetAppleCodesigningHashAgility(
+ CMSEncoderRef cmsEncoder,
+ CFDataRef hashAgilityAttrValue)
+{
+ if (cmsEncoder == NULL || cmsEncoder->encState != ES_Init) {
+ return errSecParam;
+ }
+ cmsEncoder->hashAgilityAttrValue = CFRetainSafe(hashAgilityAttrValue);
+ return errSecSuccess;
+}