Can't move keystores between machines?

Anyone have any experience with JCE?
I'm quite new to it.
We're trying to do some encryption. We create and store the key thusly:
package keystore;
import java.io.*;
import java.security.*;
import javax.crypto.*;
import java.util.*;
public class CreateKey {
    public static void main(String args[])
        throws Exception
        KeyStore ks = KeyStore.getInstance("JCEKS");
        char[] pw = "password".toCharArray();
        String alias = "testkey";
        ks.load(null, pw);
        SecureRandom sRandom = new SecureRandom();
        KeyGenerator kg = KeyGenerator.getInstance("AES");
        kg.init (256,sRandom);
        SecretKey sk = kg.generateKey();
        ks.setKeyEntry(alias, sk, pw, null);
        FileOutputStream fos = new FileOutputStream("new.keystore");
        ks.store(fos, pw);
        fos.close();
}Then, you can use keytool to list the key:
$ keytool -list -keystore new.keystore  -storepass password -storetype JCEKS
Keystore type: JCEKS
Keystore provider: SunJCE
Your keystore contains 1 entry
testkey, Aug 18, 2005, keyEntry,But, if I take that file, new.keystore, and transfer it to another machine, then the file can't be read. keytool fails. We get an invalid header error, or corrupted stream error.
The goal was to make a single key file that we can use across our vast array of developers, testers, servers, etc.
So, anyway, has anyone encountered this before? Seems odd to me that they keystore would be bound to the machine (for example, what if I stored the keystore on a thumb drive or smart card). Could it be the provider I'm using?

Using your code I have just created a keystore on Fedora Core 3 with JDK1.5.0_04. I transferred it to a Windows XP machine and ran
keytool -list -keystore new.keystore -storepass password -storetype JCEKS
which gave the expected result of
Keystore type: JCEKS
Keystore provider: SunJCE
Your keystore contains 1 entry
testkey, 19-Aug-2005, keyEntry,
I ran against the 1.4.2 keytool on Fedora Core 3 with the same result.
There has to be something more! Some other difference.
How did you transfere the file? Did you user FTP and if so did you make sure you used 'binary' mode?
Are use using the same version of JDK on both machines?

Similar Messages

  • Can I move the time machine drive from being a usb drive

    Hello
      I am not sure whether this fits best in the time capsule or in the time machine forum. I try here as this a issue thar arises only to time capsule users.
    I have a new USB drive that I want to use for time machine backups. Eventually I want it to be attached to the time capsule and make the time machine back up via wifi. However the first backup is 261 Gb and this is too long for the wi-fi. I am doing it right now via the USB and take 12 hours (estimated).
    After the USB backup will be finished, can I move the drive to the time capsule and let time machine make the backups via wifi? I mean, is time machine going to find the backup done via USB or once started with USB I am stuck with that?
    Thanks for answering and for reading
    Roberto
    PS
    maybe  was better on the time machine forum, still don't know.

    Backup strategy
    Backing up a client computer to Time Capsule hardware with Time Machine software via the network provides ample time for contemplation, and rumination as to why the backup is taking so long. An initial 200Gb backup has an estimated time of "3 days" even on a wired network. Incremental backups following the initial backup are also beset with delays, with various message which can be viewed with the programmer's delight, the "Console" app. Otherwise the System Preference Time Machine interface is mute. The glacial pace of the Time Capsule backup process is exhaustively documented on the internet, but with no solutions - at least that I have found any after too many hours searching.
    The System Preferences->Time Machine interface is always used to start a backup, monitor, or stop a backup, whether the backup drive is present on the network via Time Capsule, or if the backup drive is directly connected to the client computer.
    On the positive side, Time Machine performs quickly and provides hourly backup to external drives directly attached to the client computer. The delay appears in network backups via Time Capsule.
    Another positive is that network backups to Time Capsule are reliable when the client computer is stable, always on, and never detached from the network. In this case, the mute interface offered by system preferences->Time Machine is welcome. For example, my Apple Mac Mini web server (always on) is reliably backed up to a Time Capsule.
    The negative experience is encountered when backing up a laptop when, as laptops do, the laptop wanders from the network. As stopping a backup can take 15 minutes, backups are necessarily interrupted when dashing off to work with your laptop. In the network where I have experience, there are 5 laptops and 1 stationary (Mac Mini) clients living on an all-Apple network. Failing to complete a backup via network for days on end gives no feeling of security.
    Reading from Podini's excellent website
              http://pondini.org/TM/Works.html
    and extracting a summary, files copied from a client computer using Time Machine are stored on the backup drive in one of two formats:  sparse bundle (special file type) when backing up to Time Capsule (or to a drive attached to a Time Capsule), or a folder with the client computer name when the backup drive is Firewire attached to the client. A closer examination of the sparse bundle file on the network with the Finder shows that the same folder appears with the computer name.
    So, Time Machine backups always go to a folder with the client computer name, and this folder is either inside a sparse bundle or not depending upon if the backup drive is mounted on the network via TC or directly attached to the client.
    An external drive mounted on the network via Time Capsule will create a sparse bundle file for the client or add to it if it already exists. Even if backups are present of the same machine, but not in a sparse bundle, Time Capsule will create a sparse bundle if it does not exist for the current backup client computer, and start a new backup.
    An external drive directly connected to the client has a different experience. No Time Capsule is involved. Upon turning on backups via Time Machine, the backups will go to a sparse bundle file with the client computer name, if it exists. If the sparse bundle file does not exist, a folder is created with the computer name.
    A strategy of backing up to an external drive moved between various computers and the Time Capsule might resolve some of the many delays. The strategy is simple, if delays are encountered, directly attach the backup drive to the client computer. If a backup is to be manually deleted in order to begin anew, directly attach the backup drive to the client computer before deleting the sparse bundle file.
    To begin a new backup with this strategy of "drive+TC", initiate (via TM) the backup on the network (via TC), then stop after 10 minutes (with TM), noting that a sparse bundle of zero size is created. Continue the first backup by directly connecting the external backup drive to the client then pointing Time Machine to the newly connected drive. The backups by way of direct connect will go to the existing sparse bundle. Wait three hours rather than three days for a 200Gb backup to complete. Subsequent backups will go to the sparse bundle file on the backup drive, whether the backup drive is on the network (via TC) or directly connected.
    But what of the internal drive on the TC? In this strategy, it is not used for backups unless the client computer is always attached to the network.
    With so little documentation from Apple, we are left to speculate as to the cause of TC largo. Normally, slight documentation means little to know for the user, and the user is spared the complex machinations under the hood, but when the operation is flawed the user is left without resources.
    A secure backup strategy stores a backup offsite, just in case the house burns down, or buglers make a clean sweep of computers and backup drives. Unfortunately, this means doubling the equipment, including two Time Capsules and two external drives attached to the TCs. The offsite copy is rarely mentioned in the same paragraph as the Time Capsule, likely because of the cost. It's an uncomfortable fact that a sole TC is vulnerable to local hazards, along with the local client computers.
    This is the strategy I'm testing now. I'll send an update in a few days.

  • Can you share photos between machines that use the same wifi network? Thanks for your help.

    Can you share photos on i-photo between machines that use the same network or even between different accounts on the same machine? I know you can share music on i-tunes but can you do the same on i-photo? Thanks for your help.

    Yes.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    You can figure out using it with another machine from that too

  • Can't move messages between folders

    When trying to drag a message into a Public Folder setup for Spam, I receive the following error:
    "The IMAP command “UID COPY” (to Public Folders/GFI AntiSpam Folders/This is spam email) failed for the mailbox “INBOX” with server error: There is no replica for that mailbox on this server.."
    This is an Exchange 2003 public folder. I've created the account in Mail as an Exchange account (same settings as Tiger - in which this operation was successful).
    I can move messages around fine between other folders in the account, just not into any Public Folders.
    Anyone got any suggestions?

    No, not yet.
    I'm going to give support a call tomorrow - if this doesn't get resolved I'm going back to Tiger.

  • Can I move existing time machine backups to new, larger disk?

    I have used Time Machine with success for a long time. Now I have a much larger disk drive and want to move the old backed up files to the new drive, then continue building files after that.
    The current Time Machine backup file's Info says it is --get this-- 48.66 TB in size. But it sits on a 2 TB disk. I don't know if that's a mistake or a peculiar way to account for all the updates.
    In the Time Machine preference screen it says I have 169 GB of 2 TB available.
    Can I just copy this folder onto the new (4 TB) disk and tell Time Machine to select that as the current disk and have it continue to build and houseclean my accumulated history?
    (I've started that process, but it tells me I will be copying zillions of files and will take a boatload of time to do it. It gives me a message that there isn't enough space to make the copy. But, of course, there really is.)

    See Pondini's Time Machine FAQ: http://pondini.org/TM/18.html

  • Can I move old Time Machine backups that were USB to Network backups?

    I recently bought a new Airport Extreme and attached my 1TB WD HD to it for network file sharing and Time Machine backups. I had originally backed up my MacBook Pro with that external HD via USB directly connected to the laptop. I know (thanks to these foruns), that, since I'm now using Time Machine backups via wifi, the location of the backups is different and my wifi Time Machine can't access the backups on the HD that were made when it was directly connected.
    My question is: is there a way to move the old TM backups so that they can be recognized via wifi? If not no big deal, but then I would need to delete those backups, since they are taking up a big chunk of the external HD space. I saw a few forum posts about deleting TM backups and it seems that I would have to do it via TM itself...does that mean I have to reconnect the HD via USB to run TM so I can access those backups to delete them?
    Finally, once I do get to delete the old backups (or move them, if possible), is it safe to repartition the external HD so there is one partition for TM and one for storing files via my network? I've read about using Disk Utility to do this, but I haven't tried it yet.
    Thanks for any input.

    No, what you're doing is splitting the TM partition in half, so this will only work if you have more that 50% free space.
    See: Disk Utility - Add, Delete, and Resize Existing Volumes With Disk Utility
    My only concern about that would be that my other files would be on the same partition as the 'old' TM and thus I wouldn't want to delete it, which brings me back to my original issue of space being taken up on the drive.
    You should consider putting those files on their own partition, so think about spliiting the disk into 3 or more partitons, and 1st move all of your other files to the 3rd (last) partition.  You just need to decide how much space to allocate.
    With some limitations, you can do a lot with Partitoning without losing data, see: Disk Utility - What You Need to Know About Modifying Existing Volumes

  • I inadvertantly uploaded documents to wrong icloud account.  How do I get them back?  They were pulled off my ipad to the cloud, but they're in the wrong cloud.  Can I move them between accounts somehow?

    I accidently created two icloud accounts when setting it up on my iPad.  When I opened Pages, the documents on my iPad were moved up to account1.  I realized what I had done and then set up account2, which is the one I really need to work with for all of my stuff (account2 is the one migrated from mobile me).
    I then deleted account1 from my iPad.  When I opened Pages on my iPad, all of my documents were gone.  I can see them online on my mac when I log into account1.  I just want to find some way to move them to acc

    Did you backup as part of the update?
    You don't have them on your computer?
    Have you checked what your sync setting in iTunes are?

  • Can you move files between two different user accounts in Time Capsule?

    I copied a bunch of stuff from my old NAS (which used FAT) to Time Capsule under one user account... I then reformatted the NAS to HFS+ so I could just use it as a USB drive connected to the TC. Now I realized that I want to have one of those folders in another user directory. I cannot open two different sessions of the TC on the computer...at least I have not figured out how to do this. Is there a way to accomplish this without copying the folder to my computer, then copying it back to the other user directory? It is several gigs.

    you can crop files from one account to another using the Public Dropbox which every user account has.  Log into the user that has the files you want to move, then drag the folder you want to the new users' dropbox:
    I suggest a small scale test on a few files first before moving gigabytes of files.

  • Can't move messages between mailboxes

    When I move messages, they turn gray in the original folder, and then are not moved. Or maybe some of them are, but most are not. Or they are moved, but then moved back. I thought it might be filters, but am pretty sure all relevant ones turned off. The messages and folders are "on my mac" so imap servers are presumably not involved.

    Oh, I just did a bit more searching in the forum here, and found this answer. I tried it and it worked for me:
    http://discussions.apple.com/thread.jspa?messageID=8994288&#8994288
    "Please use Rebuild on the Inbox -- click on Mailbox in the menubar, and choose Rebuild. Be aware that during Rebuild all messages will seem to disappear, but they will come back."
    (Thank you to Ernie.)
    I have multiple mailboxes -- I had to click on each mailbox individually for Rebuild to work, and I also did the rebuild on one of my archive folders.

  • Can't move pictures between folders in a library

    For some reason I cannot drag-move pictures selected in the filmstrip or in the grid view to another folder in the library folder tree.Clicking on a picture in the filmstrip and dragging to another folder does not produce the familiar hand associated with moving files.
    This just started happening. It may be tied to inadvertent setting of read-only status in the underlying hard-disk folders. I was able briefly to recover the ability to move files by un-setting the folders's read-only status via windows properties. After the first time this did not work again, as if something was actively setting read-only. I don't know that this is the cause, it just seemed to track for a moment (untill it didn't.. )
    Is there a LR3 setting that would lock files as read-only, or otherwise disable the ability to organize pictures using drag and drop?
    Thanks in advance,
    WheatonB

    Thanks for posting back, Wheaton.
    Beat

  • Can't Move songs between playlists

    Is there a bug on Spotify for Iphone (latest IOS)? I can't add songs or transfer them btw playlists.

    Correction: it seams only for songs from local files.

  • Can't move pictures between tabs

    First, let me start out by saying I am new to Photoshop Elements. I am using PSE 12 for digital scrapbooking. Last week, all of a sudden, I am unable to use the move tool to drag and drop an imported picture from one tab to another. In the past I was able to do this without any problem, did a setting get changed somehow? I thought about re-installing the program, but I wasn't sure how that works with the serial number.
    I'm using Photoshop 12 on Windows 8
    Thanks in advance!

    Are you using photoshop elements 12?

  • Can you move After Effects from a macbook to a macpro?

    can you move After Effects from a macbook to a macpro?

    You do not want to move applications between machines.  Install them the same way you originally did using installation files.  If you need a download link....
    Download and Installation Help -
    https://helpx.adobe.com/download-install.html

  • How can I move a photo from one Album to another?

    I can touch the pic and it offers me to copy it, but how do I paste it into another album?

    You can't move pictures between albums on the iPad. You must do this on the computer that you sync the albums from.

  • HT3819 Bought new iMac & moved (or thought so) music from old PC to new Mac. Now several hundred songs are orphaned on old PC; , I can "see" them with both machines turned on & iTunes open. "Missing" songs show in iMac Shared folder. How do I move & retir

    Bought new iMac & moved (or thought I had) all of my music from the old PC to the new iMac. Have discovered several hundred songs are orphaned on old PC; I can "see" them with both machines turned on & iTunes open. "Missing" songs show in iMac itunes Shared folder. How do I move them all so I can then & retire the old PC?

    From things you are saying, such as "shared folder" and having both machines on, it doesn't sound to me like you truly moved the whole iTunes collection. 
    iTunes: How to move [or copy] your music to a new computer [or another drive] - http://support.apple.com/kb/HT4527
    do not confuse moving your whole folder and library with moving just media files as in
    iTunes for Mac: Moving your iTunes Media folder - http://support.apple.com/kb/HT1449
    Quick answer if you let iTunes manage your music:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Start iTunes with the option key held down and guide it to the new location of the library.
    Macworld - How to transfer iTunes libraries between PC and Mac - http://www.macworld.com/article/46248/2005/08/shiftitunes.html

Maybe you are looking for