ssl - BouncyCastle - how to generate PKCS10 csr in version 1.52 -
i downloaded bc*.jar files(bcprov, bcpkix, bcmail, bcpg) , put them project. eclipse cannot parse org.bouncycastle.asn1.*. documentation apparently lists asn1 related functions.
my code:
x500principal subject = new x500principal("c=no"); contentsigner signgen = new jcacontentsignerbuilder("sha1withrsa").build(pk); pkcs10certificationrequestbuilder builder = new jcapkcs10certificationrequestbuilder(subject, pub); pkcs10certificationrequest csr = builder.build(signgen); error: type org.bouncycastle.asn1.x500.x500name cannot resolved. indirectly referenced required .class files
is correct way generate csr?
appreciate!
the exception throws because of classes has dependency on org.bouncycastle.asn1.x500.x500name
, , class not in classpath. in case example pkcs10certificationrequestbuilder
use internally org.bouncycastle.asn1.x500.x500name
problem there.
the thing pkcs10certificationrequestbuilder
on bcpkix.jar
, org.bouncycastle.asn1.x500.x500name
on bcprov.jar
, add bcprov.jar
classpath.
anyways if want generate certificate signing request using java maybe it's easy using directly keytool
tool distributed jvm, , it's located on $java_home/bin/keytool
. there lot of information on internet how generate csr using keytool can search or if prefer show 1 can take here
hope helps,
Comments
Post a Comment