Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: How to start source code in JAR file with debugger?

  1. #1
    Junior Member
    Join Date
    Jun 2024
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to start source code in JAR file with debugger?

    I'm sorry, I'm newbie in Java (I'm Angular developer), I have VS code and Android studio in my computer.
    There is Google Utility www .gstatic. com/play-apps-publisher-rapid/signing-tool/prod/pepk-src.jar
    and this utility show error

    >java -version
    java version "22.0.1" 2024-04-16
    Java(TM) SE Runtime Environment (build 22.0.1+8-16)
    Java HotSpot(TM) 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)

    >java -jar E:\NativeScript\AndroidKeyStore\pepk.jar --keystore=E:\AndroidKeyStore\MyVault.jks --alias=Upload --output=E:\AndroidKeyStore\ExportedPivateKey.zip --include-cert --rsa-aes-encryption --encryption-key-path=E:\NativeScript\encryption_public_key.pem
    Enter password for store 'MyVault.jks':
    Enter password for key 'Upload':
    Error: Unable to export or encrypt the private key
    java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/OAEPWithSHA1AndMGF1Padding
    at java.base/javax.crypto.Cipher.getInstance(Cipher.java:574)
    at com.google.wireless.android.vending.developer.sign ing.tools.extern.export.ExportEncryptedPrivateKeyT ool.encryptPrivateKeyWithCkmRsaAesKeyWrapEncryptio n(ExportEncryptedPrivateKeyTool.java:284)
    at com.google.wireless.android.vending.developer.sign ing.tools.extern.export.ExportEncryptedPrivateKeyT ool.run(ExportEncryptedPrivateKeyTool.java:213)
    at com.google.wireless.android.vending.developer.sign ing.tools.extern.export.ExportEncryptedPrivateKeyT ool.main(ExportEncryptedPrivateKeyTool.java:165)

    Nobody understand why this error happens, only empty answer like this stackoverflow .com/questions/76516045/cannot-find-any-provider-supporting-rsa-none-oaepwithsha1andmgf1padding-when-t - update your Java to last version.
    I have fresh version of any software in my computer and error still happens.

    Also I check algorithm of my keystore - it cool and fresh

    >keytool -list -v -keystore E:\AndroidKeyStore\MyVault.jks
    Keystore type: PKCS12
    Keystore provider: SUN
    Your keystore contains 1 entry
    Alias name: upload
    Creation date: 14 Jun 2024
    Entry type: PrivateKeyEntry
    Certificate chain length: 1
    Certificate[1]:
    ...
    Signature algorithm name: SHA256withRSA
    Subject Public Key Algorithm: 2048-bit RSA key
    Version: 1

    Maybe I need to debug this utility line by line to understand better what happens. But I'm not a Java developer. So, first question - do anybody see error why pepk.jar not working at all? And why nobody know answer to this simple question about standard Google utility?
    And second question, I'm sorry for this stupid question - how I can debug line-by-line that JAR file - I unziped it and see that folder main/jdk1.11/org/bouncycastle/jcajce/provider/asymmetric/edec contains 4 providers. While Java engine don't attached it? Or attacked, but my JSX file used something other provider?

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,067
    Thanks
    63
    Thanked 2,710 Times in 2,660 Posts

    Default Re: How to start source code in JAR file with debugger?

    I'm not sure what you want to debug.
    Getting the statement where the exception happens out of the jar file
       javax.crypto.Cipher rsaesOaepCipher = javax.crypto.Cipher.getInstance("RSA/NONE/OAEPWithSHA1AndMGF1Padding");
    and putting it in a simple program and executing it gives the same exception:
    Exception in thread "main" java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/OAEPWithSHA1AndMGF1Padding
    at javax.crypto.Cipher.getInstance(Cipher.java:543)
    at TestCode27.main(TestCode27.java:1233)
    That's with java 8. I get the same error with java 14, 17 and 21
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jun 2024
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to start source code in JAR file with debugger?

    Thank you, @Norm. Do you mean PEPK utility? There are nothing similar line in this utility.
    Last edited by alex-199; June 24th, 2024 at 09:26 AM.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,067
    Thanks
    63
    Thanked 2,710 Times in 2,660 Posts

    Default Re: How to start source code in JAR file with debugger?

    Sorry, I do not know what the PEPK utility is. My comment was to show that I can get the same exception at execution time with the one statement that I posted. That statement was from the com.google.wireless.android.vending.developer.sign ing.tools.extern.export.ExportEncryptedPrivateKeyT ool.java source I found in the pepk-src.jar file.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Jun 2024
    Location
    Australia
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to start source code in JAR file with debugger?

    Create the JAR if you do not have it yet.
    Add a new Run Configuration: choose JAR application, specify the path to the JAR you want to run and provide the following VM options:

Similar Threads

  1. Replies: 0
    Last Post: November 17th, 2017, 08:36 AM
  2. [SOLVED] Copying from one file(source) to another file(destination)
    By help_desk in forum Java Theory & Questions
    Replies: 14
    Last Post: July 7th, 2014, 11:37 AM
  3. Source Code
    By Alaa in forum Java Theory & Questions
    Replies: 3
    Last Post: August 3rd, 2013, 05:41 AM
  4. source code
    By bashor in forum What's Wrong With My Code?
    Replies: 7
    Last Post: April 6th, 2013, 07:33 PM
  5. need help with a new way of source code
    By Balger in forum Object Oriented Programming
    Replies: 15
    Last Post: August 26th, 2012, 01:41 PM

Tags for this Thread