Adding a certificate in .cer format in .bks keystore

I need to add a certificate in .cer format to the BKS key store

It has been described here here.

How to convert .cer to BKS

I did the following, create a directory and put in the following files:

  • keytool.exe
  • bcprov-add-jdk15on-1.46.jar
  • Root_CA.cer

The next opening of Windows PowerShell and adding this command (just a replacement for my data)

.\keytool -importcert -v -trustcacerts -file "path_to_cert/interm_ca.cer"
-alias IntermediateCA -keystore "path_to_your_app/res/raw/myKeystore.bks"
-provider org.bouncycastle.jce.provider.BouncyCastleProvider
-providerpath "path_to_bouncycastle/bcprov-jdk16-145.jar" -storetype BKS
-storepass mysecret

Then press "Enter" and nothing will happen.

Error message is nothing else

Just goes to the next line

What am I doing wrong?

Feel free to ask

EDIT

if I type a command without .\- sings

like this keytool -importcert -v -trustcac.........one so i get this error

keytool: "keytool" , , script . , , . : 1 char: 1 + keytool -importcert -v -trustcacerts -file "C:\Users\alexey.t\Downloa... + ~~~~~~~     + CategoryInfo: ObjectNotFound: (keytool: String) [], CommandNotFoundException     + FullyQualifiedErrorId: CommandNotFoundException

[3, ]: keytool , . Windows PowerShell . , :..\Keytool. ." Get-help about_Command_Precedence".


 PS C:\> C:\Users\alexey.t\Downloads\ElAl_certificates\keytool -importcert -v -trustcacerts .......

PS C:> C:\Users\alexey.t\Downloads\ElAl_certificates\keytool.exe -importcert -v -trustcacerts

0
1

@Amod Gokhale

, BouncyCastle ( C:\LocalGit\certificate)

.bks

0

Source: https://habr.com/ru/post/1534868/


All Articles