[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] FW: Generation of CSR



> I recently downloaded your IAIK-JCE software for evaluation.
> 
> Using the JCE we are trying to generate a CSR using the PKCS10 class.
> However the constructor of this class generates a null pointer exception.
> I have attached the code below.
> 
> Any help you can provide would be most appreciated.
> 
> Andrew Hoard
> 
> ============================================================= 
> 
> //generates the keyPair
> 
>   public KeyPair genKey()throws KeyStoreException,
> NoSuchAlgorithmException
>   {
> 
>     KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance("DSA");
>     KeyPair keys = keyGenerator.genKeyPair();
> 
>     return keys;
>   }
> 
> // the create a certificate service request
> 
>       KeyPair kp = rks.genKey();
> //generate a key pair
> 
>       frame.getTextArea().append("\n" + kp.getPublic());
> //display the public key - check that keypair 
> 	
> //was generated
> 
>       Name name = new Name();
>       name.addRDN(ObjectID.country,country);
> //create a name object
>       name.addRDN(ObjectID.locality,locality);
>       name.addRDN(ObjectID.organization,org);
>       name.addRDN(ObjectID.organizationalUnit,orgUnit);
>       name.addRDN(ObjectID.commonName,commonName);
> 
>       frame.getTextArea().append("\n"+name.toString());
> //display and check the name object is ok
> 
>       CertificateRequest certReq = new
> CertificateRequest(kp.getPublic(),name);	// create a Certificate
> Request - this
> //throws a null pointer exception
> 
>       frame.getTextArea().append(certReq.toString());
--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content: UNSUBSCRIBE iaik-jce