Results 1 to 8 of 8

Thread: Need Java Guru

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Need Java Guru

    Im doing an encryption project for school implementing numerous
    encryption algorthms ie..... DES, DESede , Blowfish ect....

    All of the encryption algorthms use symmetrical keys so i have
    to try and implement a java.security.KeyStore; in my program
    to hold the keys.

    The encryption side of my project is completed but i cant decrypt
    until i figure out a way to store these keys. The problem i am having is that i dont fully understand what some of the parameters are for some of the methods in the java.security.KeyStore;

    for instance:

    protected KeyStore(KeyStoreSpi keyStoreSpi, Provider provider,
    String type);

    What is KeyStoreSpi?

    There is only one constructor for this class so i have to provide all of the arguments. But i have no clue what KeyStoreSpi is.


    next:
    setKeyEntry(String alias, byte[] key, java.security.cert.Certificate[] chain);

    now, secret keys are stored like private keys except they do not have a certificate chain associated with them. so what do i pass in for java.security.cert.Certificate [] chain?

    any help would be greatly appreciated

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Posts
    69

    no java guru..but would like to help

    Hey Dilenger4,

    This what I got from the api documentation:
    first part is bit confusing...

    public abstract class KeyStoreSpi
    extends Object
    This class defines the Service Provider Interface (SPI) for the KeyStore class. All the abstract methods in this class must be implemented by each cryptographic service provider who wishes to supply the implementation of a keystore for a particular keystore type.

    I can't seem to fully understand this myself...

    Second part..there is a clearer example in the API...
    The certificate takes a string from what the API indicates...

    public abstract class Certificate
    extends Object

    Abstract class for managing a variety of identity certificates. An identity certificate is a binding of a principal to a public key which is vouched for by another principal. (A principal represents an entity such as an individual user, a group, or a corporation.)

    This class is an abstraction for certificates that have different formats but important common uses. For example, different types of certificates, such as X.509 and PGP, share general certificate functionality (like encoding and verifying) and some types of information (like a public key).

    X.509, PGP, and SDSI certificates can all be implemented by subclassing the Certificate class, even though they contain different sets of information, and they store and retrieve the information in different ways.

    well the certificate chain is taking string data types...I am not sure if this helps

    I would like learn about java security
    there is a book on java security..i think orielly publication...
    suprising I don't have the book.

    Manoj

  3. #3

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Confusing isnt it? {{{laughing}}} I didnt know keyStoreSpi
    was an abstract class. Untill you said it was. Thank you.
    I found it in a security book i have. It sums up to by basically saying "Application never need to use or subclass this class".

    So i guess i can try passing in null for that arguement.

    Well it's back to the books for now.

    Thanks............

  4. #4
    Lively Member
    Join Date
    Jan 2000
    Posts
    69

    api documentation

    Hey Dilenger4,

    Do you have java api documentation? Sometimes it is hard to understand, but can point out few things...I use to find useful for basic stuff like objects and classes, etc.

    Manoj

  5. #5

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    I have probably close to about $1,000 in books. Some of the books are refrences and they only give you a little taste of the class and the methods it contains, so trying to figure out some of this stuff is confusing. I found some documentation at sun:

    http://java.sun.com/j2se/1.3/docs/gu...Implementation

    but to simply try and obtian a key store object i get errors upon compilation.

    for instance.........

    class KeyStoreTest{
    public static void main(String [] args){

    keyStorage KS = new keyStorage();
    KS.getKeyStore("JKS","SunJCE");
    }
    }


    import java.security.KeyStore;

    class keyStorage{ // non public class accesable only in it's package

    keyStorage(){};


    void getKeyStore(String type, String provider){
    KeyStore keyStore = KeyStore.getInstance.(type,provider);
    }
    }

  6. #6

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Well i got it to work alittle.

    void getKeyStore(String type, String provider){
    try {
    KeyStore keyStore = KeyStore.getInstance(type,provider);
    }catch(Exception e){System.err.println(e);}
    }

  7. #7
    Lively Member
    Join Date
    Jan 2000
    Posts
    69

    looking at it tomorrow

    dude,


    too much info lite nite reading


    Manoj

  8. #8

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width