I’m getting this error message while trying to setup to cloud build for iOS.
I’m creating this .p12 file from Keychain Access → Export “private key”.
Is there some way I can check if it’s really being created currupted my-side?
I’m getting this error message while trying to setup to cloud build for iOS.
I’m creating this .p12 file from Keychain Access → Export “private key”.
Is there some way I can check if it’s really being created currupted my-side?
Which error message do you get?
I probably can try something like
openssl pkcs12 -info -in keyStore.p12
I get “This does not appear to be a valid .p12 file. Perhaps it’s been corrupted.” when I submit it on the unity cloud configuration page.
This gives me no errors, so I can assume the key is fine:
MAC Iteration 1
MAC verified OK
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048
Bag Attributes
friendlyName: Lohoris@Goblinsama S.r.l.s. dev key
localKeyID: [abridged]
Key Attributes:
Which browser do you use, could you try a different one. Does this message appear directly on selecting the file, or once you entered the password and press next to proceed? If it is after you entered the password, would it be possible to change to password to something easy e.g. abcd to check if it might include character which might cause trouble?
I used Chrome, tried again with Safari and I got the same error.
It happens after I pick both files (provisioning and p12), enter the password, and click “save settings”.
I’ve tried both to have a simpler file name and a very simple password, and it always failed in the same way except just once where I got a “Curl error” after a while. I guess it was just a random occurrence, since using the same file again with the same password yielded the first error on next tries.
You need to export the certificate, not just the private key. ![]()
When you run the openssl command, there should be a big section that looks like:
-----BEGIN CERTIFICATE-----
….
-----END CERTIFICATE-----
Could you please try this and let us know if it works then properly? ![]()
Ok, using the certificate it works, thanks!
I was mislead since the certificate contains only my name, while I was searching for my company’s name instead…
How do you did that ?
I am still getting this error
Unfortunately I have absolutely no idea, and I haven’t exported anything to iOS ever since.
Based on my own comment, it looks like I was using the wrong certificate.
Hello,
In key chain you need to select both : certificate + private key.
Then export the 2 elements in the .p12

easier method is to go to Keychain Access, then “My Certificates” tab. Click the cert and export it to a p12 file. This will export both the cert and key.
Getting this error in UCB out of the blue for a p12 file that has 100% worked in the past. Tried re-exporting to no avail. Password is correct. Tried various browsers, and even different machines. Always the same error: “This does not appear to be a valid .p12 file. Perhaps it’s been corrupted.”
edit: Also, I checked and my p12 file also includes the -----BEGIN CERTIFICATE-----….-----END CERTIFICATE----- part
Has it expired?
We tried with a newly generated certificate that has not been expired and got the same result. On top, when building on a local Mac it worked fine with the same cert & provisioning profile.
I recommend opening up a support ticket so that we can work with you more closely to determine what is going on under the hood when we validate the .p12 files.
We’re having what appears to be the exact same issue. I know this was a few weeks ago but don’t suppose you figured out/remember what the cause was?
We’ve re-exported a p12 with new password and still no dice. Local build from Xcode builds and signs fine and can archive to TestFlight no problem, so feels very much like something in UCB. Thanks
Never found the reason unfortunately. It just speeded up our transition away from UCB to a new automated build system.
Ok, thanks for coming back to me. Unity Support have suggested recreating our Distribution certificate from scratch, which I’m loath to do, or upgrading from Xcode 15 to 15.2+ which doesn’t make too much sense to me given it’s been working fine in Xcode 15 to-date (and locally). Seems they’re the only next steps available to us.
Just an update on this for those having the same issue…
I ended up recreating our Distribution certificate from scratch along with new p12 and assigning to a new provisioning profile, then adding these to a new iOS Credentials entry in UCB. On it’s own, this didn’t result in fixed builds (still got code signing error) but it did at least allow my to upload the Credentials in UCB without error.
I then upgraded to Xcode 15.3 in UCB and the builds succeeded. So it seems these two combined resolved the issue but I’m still curious to know why the Xcode upgrade was required.
EDIT: After trying to add a new device to the new Provisioning Profile and updating again in UCB I got the same UI error about invalid .p12! I’m loath to go through the whole process of creating new Credentials all over again each time we want to add new devices.