Skip to content

Commit 6a6c76a

Browse files
committed
std.crypto.Certificate: add more object ids
1 parent a0c03c7 commit 6a6c76a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

lib/std/crypto/Certificate.zig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ pub const Algorithm = enum {
1515
ecdsa_with_SHA256,
1616
ecdsa_with_SHA384,
1717
ecdsa_with_SHA512,
18+
md2WithRSAEncryption,
19+
md5WithRSAEncryption,
1820

1921
pub const map = std.ComptimeStringMap(Algorithm, .{
2022
.{ &[_]u8{ 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x05 }, .sha1WithRSAEncryption },
@@ -26,6 +28,8 @@ pub const Algorithm = enum {
2628
.{ &[_]u8{ 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02 }, .ecdsa_with_SHA256 },
2729
.{ &[_]u8{ 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x03 }, .ecdsa_with_SHA384 },
2830
.{ &[_]u8{ 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x04 }, .ecdsa_with_SHA512 },
31+
.{ &[_]u8{ 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x02 }, .md2WithRSAEncryption },
32+
.{ &[_]u8{ 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x04 }, .md5WithRSAEncryption },
2933
});
3034

3135
pub fn Hash(comptime algorithm: Algorithm) type {
@@ -59,6 +63,7 @@ pub const Attribute = enum {
5963
organizationalUnitName,
6064
organizationIdentifier,
6165
pkcs9_emailAddress,
66+
domainComponent,
6267

6368
pub const map = std.ComptimeStringMap(Attribute, .{
6469
.{ &[_]u8{ 0x55, 0x04, 0x03 }, .commonName },
@@ -70,6 +75,7 @@ pub const Attribute = enum {
7075
.{ &[_]u8{ 0x55, 0x04, 0x0B }, .organizationalUnitName },
7176
.{ &[_]u8{ 0x55, 0x04, 0x61 }, .organizationIdentifier },
7277
.{ &[_]u8{ 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01 }, .pkcs9_emailAddress },
78+
.{ &[_]u8{ 0x09, 0x92, 0x26, 0x89, 0x93, 0xF2, 0x2C, 0x64, 0x01, 0x19 }, .domainComponent },
7379
});
7480
};
7581

@@ -93,17 +99,40 @@ pub const ExtensionId = enum {
9399
crl_number,
94100
certificate_policies,
95101
authority_key_identifier,
102+
msCertsrvCAVersion,
103+
commonName,
104+
ext_key_usage,
105+
crl_distribution_points,
106+
info_access,
107+
entrustVersInfo,
108+
enroll_certtype,
109+
pe_logotype,
110+
netscape_cert_type,
111+
netscape_comment,
96112

97113
pub const map = std.ComptimeStringMap(ExtensionId, .{
114+
.{ &[_]u8{ 0x55, 0x04, 0x03 }, .commonName },
115+
.{ &[_]u8{ 0x55, 0x1D, 0x01 }, .authority_key_identifier },
116+
.{ &[_]u8{ 0x55, 0x1D, 0x07 }, .subject_alt_name },
98117
.{ &[_]u8{ 0x55, 0x1D, 0x0E }, .subject_key_identifier },
99118
.{ &[_]u8{ 0x55, 0x1D, 0x0F }, .key_usage },
119+
.{ &[_]u8{ 0x55, 0x1D, 0x0A }, .basic_constraints },
100120
.{ &[_]u8{ 0x55, 0x1D, 0x10 }, .private_key_usage_period },
101121
.{ &[_]u8{ 0x55, 0x1D, 0x11 }, .subject_alt_name },
102122
.{ &[_]u8{ 0x55, 0x1D, 0x12 }, .issuer_alt_name },
103123
.{ &[_]u8{ 0x55, 0x1D, 0x13 }, .basic_constraints },
104124
.{ &[_]u8{ 0x55, 0x1D, 0x14 }, .crl_number },
125+
.{ &[_]u8{ 0x55, 0x1D, 0x1F }, .crl_distribution_points },
105126
.{ &[_]u8{ 0x55, 0x1D, 0x20 }, .certificate_policies },
106127
.{ &[_]u8{ 0x55, 0x1D, 0x23 }, .authority_key_identifier },
128+
.{ &[_]u8{ 0x55, 0x1D, 0x25 }, .ext_key_usage },
129+
.{ &[_]u8{ 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x15, 0x01 }, .msCertsrvCAVersion },
130+
.{ &[_]u8{ 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01 }, .info_access },
131+
.{ &[_]u8{ 0x2A, 0x86, 0x48, 0x86, 0xF6, 0x7D, 0x07, 0x41, 0x00 }, .entrustVersInfo },
132+
.{ &[_]u8{ 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02 }, .enroll_certtype },
133+
.{ &[_]u8{ 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x0c }, .pe_logotype },
134+
.{ &[_]u8{ 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01 }, .netscape_cert_type },
135+
.{ &[_]u8{ 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d }, .netscape_comment },
107136
});
108137
};
109138

0 commit comments

Comments
 (0)