一、查看姓名、学号的16进制ASCII码
echo -n "hanjin" | od -tc -tx1
echo -n "20201206" | od -tc -tx1
二、对TBSCertificate进行DER编码
1.序列号1174(0x0496)
echo -n -e "\xA0\x03\x02\x01\x02\x02\x02\x04\x96\x30\x0D\x06\x09\x2A\x86\x48\x86\xF7\x0D\x01\x01\x05\x05\x00" > 20201206.der
2.证书签发者DN="CN=Virtual CA
echo -n -e "\x30\x22\x31\x0B\x30\x09\x06\x03\x55\x04\x06\x13\x02\x43\x4E\x31\x13\x30\x11\x06\x03\x55\x04\x03\x13\x0A\x56\x69\x72\x74\x75\x61\x6C\x20\x43\x41" >> 20201206.der
3.证书有效期=20200222000000-20220222000000
echo -n -e "\x17\x0D\x32\x30\x32\x30\x30\x32\x32\x32\x30\x30\x30\x30\x5A\x17\x0D\x32\x30\x32\x32\x30\x32\x32\x32\x30\x30\x30\x30\x5A" >> 20201206.der
4.证书持有者DN=CN=Yang Chengyu, OU=Person
echo -n -e "\x30\x37\x31\x0B\x30\x09\x06\x03\x55\x04\x06\x13\x02\x43\x4E\x31\x11\x30\x0F\x06\x03\x55\x04\x0A\x13\x08\x32\x30\x32\x30\x31\x32\x30\x36\x31\x15\x30\x13\x06\x03\x55\x04\x03\x13\x0C\x68\x61\x6e\x6a\x69\x6e" >> 20201206.der
三、验证
openssl asn1parse -inform der -in ./20201206.der
标签:x32,编码,x30,ASN.1,x03,x02,x13,x06,数字证书
From: https://www.cnblogs.com/han-jin/p/17373555.html