2016-09-09 13 views
0

私はこのような証明書に画像の中にエクステンションを置く必要があります。私は多くの方法を試みましたが、できません。OpenSSLの証明書にエクステンションを置く

OK Image

私が実行している:

"#openssl req -new -keyout $nomerepre.key -out $nomerepre.csr -passin pass:$senha -config myconfig.cnf" 

"#openssl x509 -req -days 365 -in $nomerepre.csr -CA ca.crt -CAkey ca.key -set_serial 10102014 -out $nomerepre.crt -passin pass:$senha -extfile myconfig.cnf -extensions v3_req" 

マイコンフィギュレーション・ファイルは、このように
myconfigssl.conf

oid_section = OIDs 

[ req ] 
default_bits = 2048 
prompt = no 
encrypt_key = no 
default_md = sha1 
distinguished_name = dn 
req_extensions = v3_req 

[ OIDs ] 
MyOID=2.16.76.1.3.4 



    [ dn ] 
    CN = John Smith 
    emailAddress = [email protected] 
    O = QuoVadis Group 
    C = US 



[v3_req] 
1.2.3.4.5.6.7.8=ASN1:UTF8String:Something 
keyUsage = nonRepudiation, digitalSignature, keyEncipherment 
#subjectAltName = @alt_names 

[alt_names] 
MyOID = 00000000111111111112222222222233333333333444444 
2.16.76.1.3.4 = 00000000111111111112222222222233333333333444444 

これが起こっていることを残念ながら結果を下回っています。

Error image

答えて

0

EG2Oa.jpgに示すように、あなたは何の拡張子を持っていない理由を私は理解していません。そこには内線番号1.2.3.4.5.6.7.8が必要です。 SubjectAltNameはコメントされているため、証明書には含めないでください。

は、私はこの設定

# if it should be a separate extension 
2.16.76.1.3.4=ASN1:UTF8String:Some random data 

#if it should be a part of subjectAltName 
[email protected]_alt_section 

[subject_alt_section] 
otherName=2.16.76.1.3.4;UTF8:Some random data 

を使用 xca about

画像のようにショーのOpenSSL 1.0.2dを使用していますxcaを使用してみましたそして、私はこの証明書を得た

generated certificate


今やいくつかの理論。この拡張をどこに置くべきかわかりません。別の拡張子である場合、またはSubjectAltNameの一部である必要がある場合拡張子がUTF8StringかOctetStringか何かのシーケンスかどうかはわかりません。

個別の内線番号を使用する場合は、既に試したとおりに2.16.76.1.3.4=ASN1:UTF8String:Some random dataを使用できます。任意の拡張子の詳細については、hereを参照してください。

この拡張子は、oidのthe descriptionに従ってsubjectAltNameに含めることができます。 otherNameの定義はRFC5280 in section 4.2.1.6にあります。もしそうなら、この設定は私のために働いた

[email protected]_alt_section 

[subject_alt_section] 
otherName=2.16.76.1.3.4;UTF8:Some random data 

上記の設定を使って、私は下の画像のような証明書の構造を持っています。構造を示すためにASN1Editorを使用した。

Asn1 structure of the certificate

関連する問題