KeyStore and PublicKey

Discussion in 'Java' started by Rogue Chameleon, Sep 27, 2004.

  1. Hi all

    My objective is to pass an encrypted file between two servers. On server A,
    I want to use a public key to encrypt the file. On server B, I want to use
    a private key to decrypt the file.

    What I've determined so far is:

    - I will use CipherOutputStream to write out the encrypted file
    - I will use CipherInputStream to read in the encrypted file
    - I will have a password-protected .keystore file on server B that will
    contain the private key

    My question is, how do I store the public key on server A?
     
    Rogue Chameleon, Sep 27, 2004
    #1
    1. Advertisements

  2. Rogue Chameleon

    Sudsy Guest

    Rogue Chameleon wrote:
    You can use a Java Key Store (JKS) to store X.509 certificates
    (containing the public key).
     
    Sudsy, Sep 27, 2004
    #2
    1. Advertisements

  3. Could I just use the certificate to store the public key?
     
    Rogue Chameleon, Sep 27, 2004
    #3
  4. Rogue Chameleon

    Sudsy Guest

    Sure, if you've already got the .crt file. You can run into
    problems depending on the classes you use however. Some
    REQUIRE the use of a keystore (JKS, pkcs12, etc.)
     
    Sudsy, Sep 27, 2004
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.