PKG Stapling fails post successful notarization

Hi All


I am trying to Notarize and Staple a pkg installer of our app, I am facing issues with stapling

My PKG is product signed with a valid developer certificate


Following is how i verify it

spctl -a -v --type install test.pkg

test.pkg: accepted

source=Notarized Developer ID


pkgutil --check-signature test.pkg

Package "test.pkg":

Status: signed by a certificate trusted by macOS


It was successfully Notarized and status of the request shows success.

But when i try Staple the same app it fails with following error


stapler staple --verbose test.pkg

Processing: /Users/admin/Downloads/test.pkg

Properties are {

NSURLIsDirectoryKey = 0;

NSURLIsPackageKey = 0;

NSURLIsSymbolicLinkKey = 0;

NSURLLocalizedTypeDescriptionKey = "Installer package";

NSURLTypeIdentifierKey = "com.apple.installer-package-archive";

"_NSURLIsApplicationKey" = 0;

}

Sig Type is RSA. Length is 3

Could not find an appropriate "code signature" in the test.pkg installer package.

Cannot download ticket. CDHash must be set.


Please let me know how can I resolve this error.