473,499 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to generate a certificate

1 New Member
hai friends.
i got errors in generating a file.here is my codepublic
class certificate{

public static void main(String[] args) throws Exception {

CertificateFactory certFactory = CertificateFactory.getInstance("X.509");

FileInputStream fis = new FileInputStream("file");


CertificateFactory cf = CertificateFactory.getInstance("X.509");

while (fis.available() > 0) {
Certificate cert = cf.generateCertificate(fis);
System.out.println(cert.toString());
}



my error is:Exception in thread "main" java.security.cert.CertificateParsingException: invalid DER-encoded certificate data ...

what should my file contain (plaintext or some other encoded data).
Sep 24 '11 #1
0 1226

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2712
by: User1001 | last post by:
I have been trying to enable/use specific OpenSSL extensions that I use in generating certificates manually, via PHP5 + php5-openssl module/extension. Filling out the "configargs" array with...
2
6961
by: somebody | last post by:
When the generateCertPath line below is executed, I receive the following message: java.security.cert.CertificateException: unsupported encoding This is a CA certificate from Verisign. What...
7
3768
by: javatiger | last post by:
Can anyone give me the code or point me in the direction of a simple javascript certificate maker so that users can input there name and date so as to use on my site? cheers
8
6435
by: Lenn | last post by:
Hello, I've been struggling with this for couple of days now. All I want to do is to enable SSL protocol on the webserver. I want to be able to generate and sign my own certificates. I used...
3
2692
by: Charlie | last post by:
Hi: Is there any way I can setup a test SSL certificate on my development machine? My host requires I change URL's to start with https, but creates extra work because development machine...
1
1173
by: dinoo | last post by:
Can any body help me out? I know how to enable SSL by making a request certificate (to verisign) and then installing it. In .Net we have makecert.exe which can be used to generate test...
1
1940
by: FE-FR | last post by:
Hi, I am currently working on a project using smartcards for authentication. Everything work fine but I have to automate the process and I wonder if you can advise me. Here is the list of...
1
2861
by: Hamish Moffatt | last post by:
Hi, I'm fetching some files over HTTPS from Python and I want to verify the server certificate. (Not just the name etc provided in certificate.) How can I get access to this information? ...
0
2249
by: =?Utf-8?B?RGxpbng=?= | last post by:
I am getting the following error: Live communications server requires a certificate that has a valid certificate chain after I add in the policy; certutil -setreg policy\EditFlags...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.