# \[API\] Generate Keystore

**URL:** https://discuss.bitrise.io/t/api-generate-keystore/13930
**Category:** Question & Answer
**Tags:** api
**Created:** [August 13, 2020, 12:30pm UTC](https://discuss.bitrise.io/t/api-generate-keystore/13930 "2020-08-13T12:30:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![soundlicious](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@soundlicious](https://discuss.bitrise.io/u/soundlicious)
#### Post date: [August 13, 2020, 12:30pm UTC](https://discuss.bitrise.io/t/api-generate-keystore/13930/1 "2020-08-13T12:30:15Z")

</div>

Hello,

I’m trying to use the api, and I’m not sure what to use as upload\_file\_size value for the following route:  
/apps/{app-slug}/android-keystore-files  
with the following body:  
{  
“alias”: “string”,  
“password”: “string”,  
“private\_key\_password”: “string”,  
“upload\_file\_name”: “string”,  
“upload\_file\_size”: 0  
}  
I’ve gave a random number for now and got a success from the API.

When I Go to the code signing section in the workflow editor I can see that there is a keystore created but it seem to be stuck in the upload phase.

 ![Screenshot_2020-08-13%20Bitrise%20Workflow%20editor](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/2/2120adc16208ef5b52c08fe4a666d6789b71934a.png)

and when I launch my build, it fail on the signing process:

> Configs:
> 
> - BuildArtifactPath: /bitrise/deploy/app-prod-release-unsigned.apk
> 
> - KeystoreURL: [https://concrete-userfiles-production.s3.us-west-2.amazonaws.com/project\_file\_storage\_documents/uploads/56614/original/key.keystore?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIV2YZWMVCNWNR2HA%!F(MISSING)20200813%!F(MISSING)us-west-2%!F(MISSING)s3%!F(MISSING)aws4\_request&X-Amz-Date=20200813T110519Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=3ace8b7364bb23df331b2eb726bfdd1f5c7d58849b20e9e3c5557f084e11728f](https://concrete-userfiles-production.s3.us-west-2.amazonaws.com/project_file_storage_documents/uploads/56614/original/key.keystore?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIV2YZWMVCNWNR2HA%25!F(MISSING)20200813%25!F(MISSING)us-west-2%25!F(MISSING)s3%25!F(MISSING)aws4_request&X-Amz-Date=20200813T110519Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=3ace8b7364bb23df331b2eb726bfdd1f5c7d58849b20e9e3c5557f084e11728f)
> 
> - KeystorePassword: [REDACTED]
> 
> - KeystoreAlias: [REDACTED]
> 
> - PrivateKeyPassword: [REDACTED]
> 
> - JarsignerOptions:
> 
> - OutputName:
> 
> - VerboseLog: false
> 
> - APKPath:
> 
> Download keystore
> 
> using keystore at: /tmp/bitrise-sign-build-artifact958150579/keystore.jks
> 
> Failed to create keystore helper, error: [keytool error: java.io.IOException: Invalid keystore format
> 
> java.io.IOException: Invalid keystore format
> 
> at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:666)
> 
> at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:57)
> 
> at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
> 
> at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:71)
> 
> at java.security.KeyStore.load(KeyStore.java:1445)
> 
> at sun.security.tools.keytool.Main.doCommands(Main.java:825)
> 
> at sun.security.tools.keytool.Main.run(Main.java:368)
> 
> at sun.security.tools.keytool.Main.main(Main.java:361)

What am I doing wrong?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)
#### Post date: [September 12, 2020, 12:30pm UTC](https://discuss.bitrise.io/t/api-generate-keystore/13930/2 "2020-09-12T12:30:21Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
