forked from ssllabs/ssllabs-scan
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCertificates.sql
59 lines (53 loc) · 2.36 KB
/
Certificates.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*****************************************************************************/
/***** CREATE TABLE CertificatesV10 **/
/*****************************************************************************/
CREATE TABLE [CertificatesV10]
(
[ThumbprintSHA256] [nvarchar](80) NOT NULL,
[ThumbprintSHA1] [nchar](40) NOT NULL,
[CommonNames] nvarchar(MAX) NULL,
[AltNames] nvarchar(MAX) NULL,
[SerialNumber] [nvarchar](100) NULL,
[Subject] [nvarchar](300) NULL,
[IssuerSubject] [nvarchar](300) NULL,
[SigAlg] [nvarchar](30) NULL,
[RevocationStatus] [tinyint] NULL,
[Issues] [smallint] NULL,
[KeyStrength] [smallint] NULL,
[DebianInsecure] [bit] NULL,
[ValidFrom] [Datetime] NULL,
[ValidTo] [DateTime] NULL,
[CreatedAt] [Datetime] NOT NULL,
[UpdatedAt] [Datetime] NOT NULL,
CONSTRAINT [PK_CertificatesV10] PRIMARY KEY CLUSTERED
(
[ThumbprintSHA256] ASC
) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE TABLE [CertificateChainsV10]
(
[ThumbprintSHA256] [nvarchar](80) NOT NULL,
[NextThumbprintSHA256] [nvarchar](80) NOT NULL,
[CreatedAt] [Datetime] NULL,
[UpdatedAt] [Datetime] NULL,
CONSTRAINT [PK_CertificateChainsV10] PRIMARY KEY CLUSTERED
(
[ThumbprintSHA256] ASC,
[NextThumbprintSHA256] ASC
)
)
GO
ALTER TABLE [CertificateChainsV10]
WITH CHECK ADD CONSTRAINT [FK_CertificateChainsV10_CertificatesV10_ThumbprintSHA256] FOREIGN KEY ([ThumbprintSHA256])
REFERENCES [CertificatesV10] ([ThumbprintSHA256])
GO
ALTER TABLE [CertificateChainsV10]
WITH CHECK ADD CONSTRAINT [FK_CertificateChainsV10_CertificatesV10_NextThumbprintSHA256] FOREIGN KEY ([NextThumbprintSHA256])
REFERENCES [CertificatesV10] ([ThumbprintSHA256])
GO
-- ALTER TABLE [CertificatesV10] WITH CHECK ADD CONSTRAINT [FK_CertificatesV10_CertificatesV10] FOREIGN KEY([NextThumbprint])
-- REFERENCES [CertificatesV10] ([Thumbprint])
-- GO
-- ALTER TABLE [CertificatesV10] CHECK CONSTRAINT [FK_CertificatesV10_CertificatesV10]
-- GO