Certificates
ASN.1 DER 中的 EC 公鑰長度
我有兩個 DER 格式的 X.509 證書。
A:
3082013C3081E4A003020102020A47901280001155957352300A06082A8648CE3D0403023017311530130603550403130C476E756262792050696C6F74301E170D3132303831343138323933325A170D3133303831343138323933325A3031312F302D0603550403132650696C6F74476E756262792D302E342E312D34373930313238303030313135353935373335323059301306072A8648CE3D020106082A8648CE3D030107034200048D617E65C9508E64BCC5673AC82A6799DA3C1446682C258C463FFFDF58DFD2FA3E6C378B53D795C4A4DFFB4199EDD7862F23ABAF0203B4B8911BA0569994E101300A06082A8648CE3D0403020347003044022060CDB6061E9C22262D1AAC1D96D8C70829B2366531DDA268832CB836BCD30DFA0220631B1459F09E6330055722C8D89B7F48883B9089B88D60D1D9795902B30410DF
和
乙:
308201b530820158a003020102020101300c06082a8648ce3d04030205003061310b300906035504061302444531263024060355040a0c1d556e7472757374776f72746879204341204f7267616e69736174696f6e310f300d06035504080c064265726c696e3119301706035504030c10556e7472757374776f727468792043413022180f32303134303932343132303030305a180f32313134303932343132303030305a305e310b30090603550406130244453121301f060355040a0c187669727475616c2d7532662d6d616e756661637475726572310f300d06035504080c064265726c696e311b301906035504030c127669727475616c2d7532662d76302e302e313059301306072a8648ce3d020106082a8648ce3d03010703420004361f015c81c6b8cf7a14a4856f19f6a3e4101f7b8b4ca4bdb1270180625cbefe0eb8534defbb73bb6506312b8287830e13137de499cb61508303fd6f8b5b186f300c06082a8648ce3d04030205000349003046022100a9d29ac6692a6ca13b15bb64e774f3eb8192bda1f260a76a3157ba4679f88641022100d1abb880443af65efa604ca1cd29043b0bef8d7816b4fbcd2ed5da64b2942751
檢查時我注意到證書的最後一個整數序列有不同的長度。這個序列有什麼目的?這個序列的有效長度是多少?如何解釋差異?
最後2個數字是ecdsa簽名,它是兩個無符號整數,當最高字節恰好大於127時,asn.1 BER編碼增加了一個額外的零。