LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-13-2012, 10:32 PM   #1
mahao_boy
LQ Newbie
 
Registered: Sep 2011
Posts: 11

Rep: Reputation: Disabled
Smile [OpenSSL] Why CRT key, which is self-signed, size is different?


Hi,

Recently, i need to generate a self-signed certificate key by openssl.
After a long time research i found that there are two way to generate it.

1. openssl x509 -req -days 3650 -in server.CSR -signkey server.key -out server.crt
2. openssl x509 -req -days 3650 -in server.CSR -CA CA.crt -CAkey server.key -set_serial 01 -out server1.crt

And i found that the CSR request public key is 2048 bit, but in first way, the server.crt size is 4096 bit and in second way, the server1.crt is 2048 bit size.

[root@localhost]# openssl req -in server.CSR -noout -text
…..
RSA Public Key: (2048 bit)
Modulus (2048 bit):
…..
[root@localhost]#openssl x509 -noout -text -in server.crt
…..
RSA Public Key: (4096 bit)
Modulus (4096 bit):
…..
[root@localhost]# openssl x509 -noout -text -in server1.crt
……
Public Key Algorithm: rsaEncryption
RSA Public Key: (2048 bit)
……


I just want to know what the different between these two ways and why the length of crt is different.

BR
 
Old 03-15-2012, 04:48 PM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
Greetingz!

As those are all (typically) plain-text files, it should be easy to just open them up and take a look at why there different
Code:
cat certificate1
cat certificate2
IIRC, it has to do with the encoding style. Your second method incorporates the CA certificate.
NOTE: I wouldn't recommend posting anything here that has "RSA PRIVATE KEY" in it, you're supposed to make sure those are never given out.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Send HTTP request signed using private key steven.c.banks Linux - General 1 09-22-2011 09:18 AM
Can't import a cert (signed with OpenSSL) into a Java Key Store using keytool ajs418 Linux - Security 1 02-11-2011 05:51 PM
Self signed public key (GPG) prabhatsoni Linux - Software 2 09-16-2010 10:18 PM
SSL. Have crt and csr, but no key. deathsfriend99 Linux - Server 2 08-20-2010 10:33 PM
GPG encrpyted -- signed by which key? prn Linux - Security 2 03-13-2008 12:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration