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

Re: [linux] openssl et certificat de test



Ce mercredi 22 mai 2002 à 15:18:23, Pascal Bleser tapotait sur son clavier :

J'ai un peu joué avec openssl, voici ce que j'avais sauvé comme info
après avoir crée un certificat:

Creation d'une clef :
openssl genrsa -out blserv.key

Generation de la requète de certificat
openssl req -new -out blserv.pem -key blserv.key -config openssl.cnf




Generation du certificat avec signature
openssl x509 -signkey blserv.key -req -in blserv.pem -out blcert.pem
openssl x509 -signkey blserv.key -req -in blserv.pem -out blcert.pem -days 2000


=======================================================================
Fichier de configuration necessaire à openssl  (openssl.cnf)
[ req ]
default_bits           = 1024
default_keyfile        = privkey.pem
distinguished_name     = req_distinguished_name
attributes             = req_attributes
x509_extensions        = v3_ca
dirstring_type = nobmp
[ v3_ca ]

subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints = CA:true
[ req_distinguished_name ]
 countryName                    = Country Name (2 letter code)
 countryName_default            = AU
 countryName_min                = 2
 countryName_max                = 2

 localityName                   = Locality Name (eg, city)

 organizationalUnitName         = Organizational Unit Name (eg, section)

 commonName                     = Common Name (eg, YOUR name)
 commonName_max                 = 64

 emailAddress                   = Email Address
 emailAddress_max               = 40

 [ req_attributes ]
 challengePassword              = A challenge password
 challengePassword_min          = 4
 challengePassword_max          = 20

===================================================================================


PB> Dites, qqn pourrait me donner en qqes lignes la marche à suivre pour créer
PB> un certificat SSL de test, signé par moi-même (donc sans devoir passer par
PB> verisign & cie) ?

PB> J'ai fait un

PB> openssl req -newkey rsa:1024 -x509

PB> et entré les infos demandées.
PB> Il m'a créé un privkey.pem
PB> -----BEGIN RSA PRIVATE KEY-----
PB> Proc-Type: 4,ENCRYPTED
PB> DEK-Info: DES-EDE3-CBC,....
PB> ....
PB> -----END RSA PRIVATE KEY-----

PB> et m'affiche un certificat signé
PB> -----BEGIN CERTIFICATE-----
PB> ...
PB> -----END CERTIFICATE-----

PB> Quand j'utilise ces deux fichiers-là tels quels (pour BEA WebLogic Server 6.1),
PB> il me dit
PB> ...
PB> Java.io.IOException: Length is too big: takes 14 bytes
PB>          at
PB> weblogic.security.ASN1.ASN1Header.inputLength(ASN1Header.java:148)
PB>          at weblogic.security.ASN1.ASN1Header.input(ASN1Header.java:120)
PB>          at weblogic.security.RSAPrivateKey.input(RSAPrivateKey.java:113)
PB>          at weblogic.security.RSAPrivateKey.<init>(RSAPrivateKey.java:91)
PB>          at
PB> ...
PB> (ce message-là, c'était avec rsa:384, avec 1024 il me disait autre chose que 14 bytes)

PB> Je dois encore faire qqe chose d'autre avec ?
PB> openssl ca ... ?
PB> openssl x509 ... ?



-- 
A+, 
Didier
          mailto:didierh@fastmail.fm

_______________________________________________
Linux Mailing List
LCP - 11 Mai - http://www.unixtech.be/lcp.php
Archives: http://www.unixtech.be/mailman/listinfo/linux