How to decrypt to get the message digest?

Ok, I'm aware that, message digest, is a one-way hash algorithm. From what I gathered, we can decrypt then use the MessageDigest method, IsEqual to compared the hash value to ensure they are the same right?
But my problem is, right now, I has the code to encrypt and digitally signed on a xml.
But no one has used it before to decrypt. So i need to find out how.
Below is the code to generate the signed XML.
Can anyone tell me how to decrypt it?
Thanks...
    public boolean generateSignXmlDocument(String xmlDocPath, String newDocPath, KeyStore keystore, String alias, String password)
        boolean status = false;
        try
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            DocumentBuilder builder = dbf.newDocumentBuilder();
            File f = new File(xmlDocPath);
            Document doc = builder.parse(new FileInputStream(f));
            KeyPair kp = getPrivateKey(keystore, alias, password);
            DOMSignContext dsc = new DOMSignContext(kp.getPrivate(), doc.getDocumentElement());
            String providerName = System.getProperty("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI");
            log.info("Creating xml sign.....");
            log.debug("Provider Name " + providerName);
            XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM", (Provider)Class.forName(providerName).newInstance());
            javax.xml.crypto.dsig.Reference ref = fac.newReference("", fac.newDigestMethod("http://www.w3.org/2000/09/xmldsig#sha1", null), Collections.singletonList(fac.newTransform("http://www.w3.org/2000/09/xmldsig#enveloped-signature", null)), null, null);
            javax.xml.crypto.dsig.SignedInfo si = fac.newSignedInfo(fac.newCanonicalizationMethod("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments", null), fac.newSignatureMethod("http://www.w3.org/2000/09/xmldsig#rsa-sha1", null), Collections.singletonList(ref));
            KeyInfoFactory kif = fac.getKeyInfoFactory();
            javax.xml.crypto.dsig.keyinfo.KeyValue kv = kif.newKeyValue(kp.getPublic());
            javax.xml.crypto.dsig.keyinfo.KeyInfo ki = kif.newKeyInfo(Collections.singletonList(kv));
            XMLSignature signature = fac.newXMLSignature(si, ki);
            signature.sign(dsc);
            java.io.OutputStream os = new FileOutputStream(newDocPath);
            TransformerFactory tf = TransformerFactory.newInstance();
            Transformer trans = tf.newTransformer();
            trans.transform(new DOMSource(doc), new StreamResult(os));
            status = true;
        catch(Exception e)
            log.error(e);
        return status;
    }

Kyle Treece wrote:
It says that both IMAP and POP are enabled in my settings.
what settings ? in gmail webmail interface? I'm talking about how your gmail account is configured in Mail on your computer. It's configured for POP. you need to delete it from Mail and then create a new account in Mail and make it IMAP. do not use automated account setup which Mail will offer to do. that will make the account POP again. enter all server info and account type by hand.
see this link for details
http://mail.google.com/support/bin/answer.py?answer=81379
If I turn POP completely off, will it kick all the messages out of my iPhone?
as I said, this is not about turning something on or off in webmail gmail. you have to configure your email client Mail correctly. it will have no effect on your iphone.

Similar Messages

  • How do I stop getting the messages sent on my iPhone onto my ipad?

    When my friend messages me on my iPhone I get the messages on my ipad as well. It's annoying. How do I stop this?

    Get a separate email address (gmail) to use for messages on your iPad.
    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    For non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
     Cheers, Tom

  • Every time I start iTunes I get the message: "iTunes exec has been set to run in compatability mode for an older version of Windows. Turn off compatability mode for iTunes before you open it." How do I turn off the compatability mode?

    Every time I start iTunes I get the message: "iTunes exec has been set to run in compatability mode for an older version of Windows. Turn off compatability mode for iTunes before you open it." How do I turn off the compatability mode? Particularly when I have to do it before I turn on iTunes.

    Try the following document, only be sure that none of the boxes in the compatibility mode tab are checked (not just the compatibility mode box itself):
    iTunes for Windows: How to turn off Compatibility Mode

  • How can I get my ES2 loops to play correctly? I keep getting the message that the audio is not found when I drag the loops from my audio browser even though they play fine in the preview.

    How can I get my ES2 loops to play correctly? I keep getting the message that the audio is not found when I drag the loops from my audio browser even though they play fine in the preview.

    It's exactly as I stated. Whenever I try to drag these kinds of loops (ESX24 / software instrument loops? the ones marked in green with the white music note next to them) from the loop browser into the timeline a message comes up saying Audio Not Found for that loop.  And a new track is created automatically when loops are dragged into the timeline, so I'm not creating some other random / synth instrument track so I'm not sure  what the deal is... But perhaps I'll try creating a software instrument track first and then drag the loop into that track and see what happens - maybe there's something with the default settings that automatically creates audio tracks whenever loops are imported?

  • When trying to update, I get the message: Account not in this store,...switch to the Canadian store.  How do I do that?

    When trying to update apps, I get the message:  "Account not in this store,...switch to the Canadian store before purchasing"  How to I switch, and how did it even get changed to US store?  I don't remember changing anything, and I used to be able to update, no problem..  I have synced with my computer for music - could it have happened then?  I changed on the computer to Cdn site, but will it not go to the iPhone automatically?

    On you iPhone go to settings-iTunes & AppStore.
    Tap user name, sign out.
    Log back in with your apple ID and password.
    That should fix the problem

  • How to get the message from a Runnable class

    The Schedule class is actually a JFrame, what I want to do is to "get" the message from Scheduler Class and display it in a JTextField, to let user know what is doing.
    How can I approach this?
    public class Schedule {
        @SuppressWarnings("static-access")
        public static void main(String args[]) throws InterruptedException {
            final Scheduler s = new Scheduler();
            Thread t = new Thread(s);
            t.start();
    public class Scheduler implements Runnable{
    private static int actionType;
    private static String msg;
        public static void setMsg(String msg) {
            Scheduler.msg = msg;
        public static String getMsg() {
            return msg;
        public void run() {
            //System.out.println((int)(Math.random() * 1000));
            actionType = 1;
            while(true){
                try {
                    switch(actionType){
                        case 1:
                            setMsg("Process actionType: "+actionType);
                            break;
                            case 2:
                            Thread.sleep(2000L);
                            setMsg("Process actionType: "+actionType);
                            break;
                            case 3:
                            Thread.sleep(2000L);
                            setMsg("Process actionType: "+actionType);
                            break;
                            case 4:
                            Thread.sleep(2000L);
                            setMsg("Process actionType: "+actionType);
                            break;
                    actionType++;
                    if(actionType>4){
                        actionType = 1;
                } catch (InterruptedException ex) {
                    System.out.println("Scheduler.run:"+ex.toString());
    }

    Or with only one loop:
            int actionType = 0;
            while (true)
                actionType = (actionType % 4) + 1;
                msg = "Process actionType: " + actionType;
                try
                    Thread.sleep(2000L);
                catch (InterruptedException ex)
                    System.out.println("Scheduler.run:" + ex.toString());
            }

  • Just upgraded to the latest version of iTunes. Now I get the message "the Item you requested is not currently available in the US store." When I click on OK, the dialgue goes away, but the store doesn't open. How do I fix this?

    Not sure why I am getting this message anyway. I wasn't trying to buy anything. I just upgraded and then I tried to access the store. I had two purchases that I had previously made from a different computer. I was going to download them to this computer as my iPod is synced to this computer and you can only sync it to one computer. I was able to view my account information and from there I was able to click on the Purchased link. I saw the two items and downloaded them. But I received an error about the second album. It said that I didn't have sufficient privileges. When I checked all the songs had downloaded. Only the booklet was missing. Maybe this has something to do with the issue, I don't know. As far as I know, I purchased everything from the US store. I don't even know how to switch to a different store.
    In any case, I can't access the store because the item I requested is not currently available in the US store. So why don't they just dump me at the home page instead of blocking me completely.

    It is working now. I no longer get the message about the item not being available in the US and I can access the store.

  • When I try to download the latest version of iTunes on my iPod Classic I get the message that "iTunes has an invalid signature" and that "Content was blocked because it was not signed by a valid security certificate.  Anyone know how to fix this?

    When I try to download the latest version of iTunes from apple.com, I get the message "Content was blocked because it was not signed by a valid security certificate."When I open iTunes and try to download the latest version there, I get the message "iTunes has an invalid signature.  The download has been removed."  I have also gotten an Internet Script Error stating that an error has occured in Line 0, Char O and that "Access is denied to images.apple.com/global/scripts/lib/iepngfix.htc."  This problem has never occurred with earlier versions of ITunes.  Anyone know how to fix this problem? 

    Are you downloading iTunes form an Apple website or somewhere else? If the answer is somewhere else, try downloading it from Apple. Click on iTunes in the black menu bar above and go from there.
    Let us know what happens.

  • HT5622 When trying to log on to I-Cloud with my Apple Id, I keep getting the message that this is a valid Apple Id but not an I-cloud account???How do I link my I-Tunes Apple Id with I-Cloud?

    When trying to log on to I-Cloud with my Apple Id, I keep getting the message that this is a valid Apple Id but not an I-cloud account???How do I link my I-Tunes Apple Id with I-Cloud?

    You are logging in iCloud for the first time. In this case, first you need to log in iCloud on an iPhone, iPad, iPod touch or Mac. See > http://www.apple.com/icloud/setup
    If you have not got a device to set iCloud up, you cannot use it. You can only use iCloud on your PC if you have got an Apple device

  • I keep getting the message that my computer is associated with another apple id. I have already removed the device from the other apple id but I still get the message. How long does it take to update?

    I am trying to download a tv show that I purchased and I get the message that my laptop is already associated with another apple id. I knew it was my wifes id so I went into her account and removed the association. I still get this message even though there is no other apple id associated with the laptop now.

    That's not how it works. Once a device (including a computer) is associated with an Apple ID it cannot be switched for 90 days. See this Apple KB article for more information: http://support.apple.com/kb/HT1420.

  • I have an iMac OS 10.9.5 - Every time I turn on my system I get the message that it can not access icloud and to fix it using iCloud preferences. I do not want to access or use iCloud, how do I get the message to discontinue?

    I have an iMac OS 10.9.5 - Every time I turn on my system I get the message that it can not access icloud and to fix it using iCloud preferences. I do not want to access or use iCloud, how do I get the message to discontinue?

    Hello mrmacjohn,
    Verifying that any iCloud account that may be signed in is signed out should resolve this error.
    On your Mac, open iCloud preferences, then click Sign Out.
    iCloud: Change iCloud feature settings
    http://support.apple.com/kb/PH2613
    Cheers,
    Allen

  • TS4020 I live in a house with multiple iCloud users.  When they try to turn on "Find my computer"  they get the message that they will have to disable my "find my computer" setting in order to enable theirs.  How can they all be enabled at the same time?

    I live in a house with multiple iCloud users.  When they try to turn on "Find my computer"  they get the message that they will have to disable my "find my computer" setting in order to enable theirs.  How can they all be enabled at the same time?

    Try this support document for information on how to contact Apple and account security. Apple ID: Contacting Apple for help with Apple ID account security

  • How do I get my videos to upload from my sony handy cam when I get the message The following file could not be imported.  The file is in an unrecognized format. I am using a macbook pro version 10.9.3, I have 411 gb free space, it worked before I updated

    How do I get my videos to upload from my sony handy cam when I get the message The following file could not be imported.  The file is in an unrecognized format. I am using a macbook pro version 10.9.3, I have 411 gb free space, it worked before I downloaded the latest update for iphoto.

    You may be able to download and install the update from here: Digital Camera RAW Compatibility 6.01
    If I upgrade to Yosemite will I be forced to go to the new Photos program
    No. After upgrading (and of course make a back up first) you will need to update iPhoto to v9.6.1 (you won't be able to do this prior to upgrading). Here's how:
    Go to the App Store and check out the Purchases List. If iPhoto is there then it will be v9.6.1
    If it is there, then drag your existing iPhoto app (not the library, just the app) to the trash
    Install the App from the App Store.
    Sometimes iPhoto is not visible on the Purchases List. it may be hidden. See this article for details on how to unhide it.
    http://support.apple.com/kb/HT4928
    One question often asked: Will I lose my Photos if I reinstall?
    iPhoto the application and the iPhoto Library are two different parts of the iPhoto programme. So, reinstalling the app should not affect the Library. BUT you should always have a back up before doing this kind of work. Always.
    Photos is v1 of a new app, as yes it's not as mature as iPhoto. It uses a different technology for working with external editors. That requires Adobe to write an extension to let it hook into the new app. Not done yet, neither has anyone else.
    Going forward: iPhoto will run on OS 10.10., but there is no guarantee for subsequent versions of the OS. You might want to factor that into your anger term thinking.

  • Ever since I enabled iMessage on my Mac Airbook, I can no longer receive text messages from the iMessage people on my iPhone, only on my iMessage now!!  How do I get the messages to reach both iMessage and iPhone??

    Ever since I enabled iMessage on my Mac Airbook, I can no longer receive text messages from the iMessage people on my iPhone, only on my iMessage now!!  How do I get the messages to reach both iMessage and iPhone??

    We are suffering very similar issues when communicating from my iphone to a friend who has both iphone and iPad enabled.
    As long as I reply to an existing text chain, then it is visible on the target iphone.  If I SMS the phone number, it gets routed to the IPAD!!   And NO, I should not have to disable imessage when I want to send an SMS!!

  • HT1386 I have been syncing my IPad to only one PC computer successfully for over a year.  Now when I try to sync I get the message that the ipad is synced with another computer and can be synced with only one.  How can I correct this?

    Although I have synced my ipad to only one PC computer I now get the message that it is synced to another computer and only one computer sync is permitted.  I have lots of apps on the ipad and do not want to loose everything by starting fresh with the ipad.  How can I get the ipad to again accept my computer and sync successfully?

    Plawexki wrote:
    ...  do you know if the contacts, photos, messages etc will be wiped?
    Yes... Everything will be Wiped and Replaced with what is currently on Your Mac.
    SYNCING with iTunes
    See here  >  http://support.apple.com/kb/HT1386
    From Here  >  http://www.apple.com/support/iphone/syncing/
    You may find this information of interest...
    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

Maybe you are looking for