Does it have a way to get PublicKey as a String

I want to implement RSA in java and javascript. But it seems there is no way to receive a public key as a String in Java API (cause i need to use the key in javascript at client side)
I want to know whether this implementation is possible or not.
Thx

The following code snippet should read a X509Certificate out of a file and extract the modulus and the public exponent as instances of the class BigInteger.
String filename;
FileInputStream fis;
BufferedInputStream bis;
CertificateFactory cf;
X509Certificate cert;
try
    fis = new FileInputStream(filename);
    bis = new BufferedInputStream(fis);
    cf = CertificateFactory.getInstance("X.509");
    while (bis.available() > 0)
        cert = (java.security.cert.X509Certificate)
               cf.generateCertificate(bis);
    RSAPublicKey rsaPublicKey = (RSAPublicKey)cert.getPublicKey();
    BigInteger   modulus = rsaPublicKey.getModulus();
    BigInteger   exponent = rsaPublicKey.getPublicExponent();
catch( Exception e )
}

Similar Messages

  • HT1267 what if your iphone 4 does not turn on and you dont have any way to get the Serial number what do u do

    what if your iphone 4 does not turn on and u have no way to get the serial number what do u do

    If you eject the SIM card tray the serial number is also there.  It's tiny, but there.
    When my iPhone won't turn on I first charge it with a known good cable for a few hours.  If nothing after that I begin a warranty lookup for repair.

  • I have a mac book pro.  Yesterday the mail app failed to open.  I have tried to open it fomr the dock and the application folder but nothing happens.  Does anyone have any suggestions to get it to work?

    I have a mac book pro.  Yesterday the mail app failed to open.  I have tried to open it from the dock and the application folder but nothing happens.  Does anyone have any suggestions to get it to work?

    You don't need iDVD unless you are going to make DVDs. If you are just trying to share files, iDVD won't help you at all.
    What you want to do is in iMovie, choose File/Share/File, and export that way. It creates an .mp4 file that should be readable on Macs or Windows.
    You could also File/Share/YouTube if you don't mind posting them to YouTube, because of course YouTube videos are watchable by any Mac or Windows computer made in the last 10 years.

  • Is it possible to download my purchase history? I don't have icloud set up, so have no way to get to my 300 odd songs

    Is it possible to download my purchase history? I don't have icloud set up, so have no way to get to my 300 odd songs

    Matthewmillnerr wrote:
    Is it possible to download my purchase history?
    No.  You can view it, and save or print it a page at a time as screenshots.  But unlike Amazon MP3, the iTunes Store does not provide a way to download your Purchase History all at once.
    Some folks on this forum have said that upon request to iTunes Customer Service they will email you the complete list, but others have said they were refused.  Worth a try I suppose.

  • HT1711 When I am in the iTunes store site and listening to samples of music the songs stop playing after 12 seconds. Does anyone know a way to get it to play the full one and one half minutes?

    When I am in the iTunes store site and listening to samples of music the songs stop playing after 12 seconds. Does anyone know a way to get it to play the full one and one half minutes?

    I have a similar problem with at least two songs that I know of, one is an iTunes download (encrypted) the other was imported from a CD using iTunes (no encryption). Both songs play 2-3 seconds then immediately go to the next song. The "weird" thing -- I plugged my iPod into my new MacBook which has no songs other than what are on my iPod (i.e., not playing the song from another source) and both songs play fine. Unplug the iPod from the computer, plug in headphones and the songs skip again.
    I've gone through the 5 R's as well, with no luck.

  • HT1459 My iPod touch screen just turned a white-ish green color and I can't turn it on or off. I can't connect it to iTunes, and the back is too scratched up to see the serial number so I have no way of getting it. Can someone tell me how to fix it?

    My iPod touch screen just turned a white-ish green color and I can't turn it on or off. I can't connect it to iTunes, and the back is too scratched up to see the serial number so I have no way of getting it. Can someone tell me how to fix it? Please tell me quickly! I was right in the middle of something!

    Did you try a reset?
    iPod touch User Guide (For iOS 5.1 Software)

  • Does Apple have a way to manage iTunes accounts on Corporate owned devices, meaning if someone leaves the company how does the company access the purchase apps as they are the owner of them.

    Does Apple have a way to manage iTunes accounts on Corporate owned devices?  So, if someone leaves the Corp. how would the company have access to all purchased apps for any device.

    If the apps were purchased using a corporate iTunes account, someone at the company should have the password. If they were purchased under a user's iTunes account, even though the device was owned by the company, the apps are tied to the user's Apple ID and do not belong to the company.

  • I cannot beleive VZW does not have a way to black ALL international calls

    My husband has been receiving harassing international call for well over a year. He answered the first few and there were a couple of girls laughing and speaking in a foreign language. He has not answered these calls since but they will not stop. Yesterday he received 33 calls from the same number. They use so many different numbers and area codes it is impossible to block them all. VZW of course wants him to change his number but it is a business number and they may be too costly to us. So yesterday I had to sign up for usage controls which is $5 a month/ $60 per year to try to stop them. I load in the max of 20 numbers allowed by VZ to block and this morning when we checked his phone the was a totally different number on the missed call list!
    I cannot believe a company as technically advanced as VZ does not have a way to block ALL international calls.
    Does anyone have any suggestions other than changing his number?

    Assuming your content was purchased from the iTunes Store, go to the iTunes Store, log into your account, and click the Purchases link under the Quick Links. From there you should be able to re-download some or all of your purchased content. Note that not all content has been licensed for re-downloading in all countries at this time. You can see what content you can download here:
    http://support.apple.com/kb/HT5085
    You can also re-download content using an iOS device.
    For full instructions, see:
    http://support.apple.com/kb/ht2519
    Regards.
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Communities page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums and in the Apple Knowledge Base, before you post a question.

  • I just bought an iPhone 4 a few weeks back. I tried to delete their icloud account, and add mine but it's asking for a password to delete it. I have no way to get in contact with them. Is there any way around it?

    I just bought an iPhone 4 a few weeks back. I tried to delete their icloud account, and add mine but it's asking for a password to delete it. I have no way to get in contact with them. Is there any way around it?

    There's no way around it.  The former owner needs to erase the phone and remove it from their account as explained here: http://support.apple.com/kb/TS4515.  No one else can help with this, including Apple.

  • Having trouble opening a pdf with Adobe...keep seeing an error sign "acroExch"  does anyone have a way to fix this?

    Having trouble opening a pdf with Adobe...keep seeing an error sign "acroExch"  does anyone have a way to fix this?

    Hmm, "Use Adobe Reader" should launch the PDF outside of Firefox in the stand-alone Adobe Reader application, so seeing it in a tab is something of a puzzle.
    Could you check your version of Adobe Reader? For Windows 7, you normally would have the Reader XI series (Reader 11), which has had several updates. From inside Adobe Reader, you can use Help > Check for Updates to make sure it's current.
    In Firefox, could you check your Adobe Acrobat plugin version or possibly versions? You can view that on the Add-ons page. Either:
    * Ctrl+Shift+a
    * "3-bar" menu button (or Tools menu) > Add-ons
    In the left column, click Plugins. If you find multiple versions, this can cause problems and may need to be cleaned up manually (post back on that for suggestions).
    Sometimes, the settings file which stores those download handler preferences becomes corrupted and there's not much else to do than to rename or remove that file and let Firefox rebuild it.
    To do that, open your current Firefox settings (AKA Firefox profile) folder using either
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * (menu bar) Help > Troubleshooting Information
    * type or paste about:support in the address bar and press Enter
    In the first table on the page, click the "Show Folder" button. This will launch a new window (Windows Explorer window) listing various settings files.
    Leaving that window open, switch back to Firefox and Exit, either:
    * "3-bar" menu button > "power" button
    * (menu bar) File > Exit
    Pause while Firefox finishes its cleanup, then rename '''mimeTypes.rdf''' to something like mimeTypes.old
    Start Firefox back up again and "PDF Files" should be back to their default setting of "Preview in Firefox". Try changing that to "Use Adobe Acrobat (in Firefox)" and test to see whether there's any improvement.

  • Do we have a way to get the differences between xtext model before and after partial parse?

    Do we have a way to get the differences between xtext model before and after partial parse?
    As an example i have file contains 4 lines, xtext parsed this file and generated its model, then i made small modification in line number 3, so xtext partially parsed the file and generated another model.
    The question is could we get the nodes that has been deleted from the model?
    could we get the new nodes added to the model?
    could we get the differences between the two models?

    Workflow {
    bean = StandaloneSetup {
    scanClassPath = true
    platformUri = "${runtimeProject}/.."
    // The following two lines can be removed, if Xbase is not used.
    registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
    registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
    component = ParseXextModel{
    //Load the xtext model and keep the reference of the inmem model
    component = DirectoryCleaner {
    directory = "${runtimeProject}/src-gen"
    component = DirectoryCleaner {
    directory = "${runtimeProject}/model/generated"
    component = DirectoryCleaner {
    directory = "${runtimeProject}.ui/src-gen"
    component = DirectoryCleaner {
    directory = "${runtimeProject}.tests/src-gen"
    component = Generator {
    pathRtProject = runtimeProject
    pathUiProject = "${runtimeProject}.ui"
    pathTestProject = "${runtimeProject}.tests"
    projectNameRt = projectName
    projectNameUi = "${projectName}.ui"
    encoding = encoding
    language = auto-inject {
    uri = grammarURI
    // Java API to access grammar elements (required by several other fragments)
    fragment = grammarAccess.GrammarAccessFragment auto-inject {}
    // provides a compare view
    fragment = compare.CompareFragment auto-inject {}
    component = ParseXextModel{
    //Load the xtext model again and keep the reference of the inmem model
    component = CompareModel {
    //Implement this using EMF Comapre to see the differnces between 2 models
    }

  • Does mail have a way to verify if someone receives an email and opens it

    Question: does Mail have a way to verify if someone receives an email and/or opens it? Burt Brown ,StCharles Illinois

    No. Read receipt is not a feature available in Mail.
    Best.

  • Old email is closed.  I have no access to it.  Cannot change email address for icloud in system preferences,does anyone have a way this can be corrected?  I don't have access to icloud.

    Old email is closed.  I have no access to it.  Cannot change email address for icloud in system preferences,does anyone have a way this can be corrected?  I don't have access to icloud.

    Hi Joycars,
    Can you not simply sign out of the iCloud account with the incorrect email? Not sure I'm following?
    GB

  • HT201441 i bought my iphone secondhand, and the previous owner didnt deltete his find my iphone account, so when i restored it i know cant access my phone, i need help as i have no way of getting intouch with the previous owner whatsoever :/ help!

    i bought my iphone secondhand, and the previous owner didnt deltete his find my iphone account, so when i restored it i know cant access my phone, i need help as i have no way of getting intouch with the previous owner whatsoever :/ help!

    Welcome to the Apple community.
    Unfortunately, you cannot do very much with your phone unless you get assistance from the previous owner, they should either provide you with the password to unlock it or remove their account from the phone entirely remotely through iCloud.com > Find My Phone.

  • I've lost my contacts after upgrading to ios7. Does anyone have an idea it get them back. My phone was not backed up beforehand

    i lost all my contacts upon upgrading to ios7. Does anyone know how I can get them back. my phone was not backed up beforehand.

    You can solve this problem by this method.
    You may need a third party easy iPhone recovery tool to recover your contacts.
    http://easy-iphone-recovery.blogspot.com/iphone-recovery-resource.html
    This tool can help you to recover the lost contacts directly from your iPhone. Please have a try.
    If it works, try to pay for it to get the full recovery feature.

Maybe you are looking for

  • I had 50/25 internet installed yesterday, and has been going in and out since. What's wrong?

    Just to clarify, when I say going in and out, I never lose either "internet light" on my modem or on my computer. It stays connected but the speeds drop to basically zero and I cannot open anything. It seems to only happen when I have more than one i

  • AirPort loosing connection

    Hi, I have a time capsule which works for backing up my data. I have configured two Airport Express units to connect to iTunes. When i connect through iTunes this works fine for 10 seconds then the connection drops out. The green light is still lit o

  • Vendor Master Ship to / Bill to

    Dear Friends, Is it possible to have multiple Ship to Addresses for One single vendor. The vendors are service providers to whom Installation material needs to be despatched ( One vendor would be operating from Various states). No invoices are to be

  • Screen validations

    Hi Experts, How can i do the screen validations with Ranges. The below is the Description in the Func. Specs. Posting date-FAGLFLEXA-BUDAT-Range with F4 help on date. Single Multiple values should also work G/L Account-FAGLFLEXA-RACCT-Range with F4 h

  • Bridge CS4 not rendering images correctly

    i have macbook 10.4.11 with 60 GB free, and 2GB of RAM and when i hit the space bar in bridge to view my photos at full screen the photos do not sharpen. they used to but now they don't, they just remain blurry. i have tried "purge cache" and checkin