Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8681713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:34:55+00:00 2026-06-12T21:34:55+00:00

Has Anyone run into this problem? I am trying to use BouncyCastle to Create

  • 0

Has Anyone run into this problem?

I am trying to use BouncyCastle to Create Certificate in Android but as soon as I have added BouncyCastle Provider Jar, I get Java Heap Space problem, Eclipse crashes with OutOfMemory error.

All I am doing is following, which is similar to Example code in bouncy castle,

public static X509Certificate createMasterCert(
    PublicKey pubKey,
    PrivateKey privKey)
    throws Exception
{
    //
    // signers name
    //
    String issuer = "C=AU, O=The Legion of the Bouncy Castle, OU=Bouncy Primary Certificate";

    //
    // subjects name - the same as we are self signed.
    //
    String subject = "C=AU, O=The Legion of the Bouncy Castle, OU=Bouncy Primary Certificate";

    //
    // create the certificate - version 1
    //
    X509v1CertificateBuilder v1CertBuilder = new JcaX509v1CertificateBuilder(
        new X500Name(issuer),
        BigInteger.valueOf(1),
        new Date(System.currentTimeMillis() - 1000L * 60 * 60 * 24 * 30),
        new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 30)),
        new X500Name(subject),
        pubKey);

    X509CertificateHolder cert = v1CertBuilder.build(new JcaContentSignerBuilder("SHA1withRSA").setProvider(BC).build(privKey));

    return new JcaX509CertificateConverter().setProvider(BC).getCertificate(cert);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:34:56+00:00Added an answer on June 12, 2026 at 9:34 pm

    If this code is being executed in Android, increasing Eclipse’s heap size will do nothing for you, because it simply has nothing to do with it. The heap size of Android applications is fixed and you cannot increase it (not before Honeycomb anyway). What version of Android are you using? Additionally, the BouncyCastle libraries are part of Android, so even if you add them to your project, it will use the system ones, which are slightly different and this can lead to subtle (and not so subtle) errors. IF you want to use BC on pre-Honeycomb (3.0) platforms you need to change the package name or include Spongy Castle which already does this for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone run into this problem? I have a collection of comments that I
Has anyone ever run into this issue before? Sometimes the string displays, sometimes half
I am curious to see if anyone else has run into this same issue...
Has anyone mapped out a way to create a hot-key for 'Run As' in
has anyone an idea why I have the following problem with passing locals to
Has anyone met this error? Right now i am trying to do switch from
I have run into a slight problem, and have been tyring to debug it
Has anyone ever used the hidden class PackageParser in Android source code with java
Has anyone else come across this at all? I used to be able to
Before I get flak for trying to create iPhone style elements on Android, it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.