-
Notifications
You must be signed in to change notification settings - Fork 748
Expand file tree
/
Copy pathRepositoryCertificateInfo.cs
More file actions
56 lines (47 loc) · 2.16 KB
/
RepositoryCertificateInfo.cs
File metadata and controls
56 lines (47 loc) · 2.16 KB
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
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Newtonsoft.Json;
using NuGet.Packaging.Core;
using System.Text.Json.Serialization;
namespace NuGet.Protocol
{
public class RepositoryCertificateInfo : IRepositoryCertificateInfo
{
[JsonProperty(PropertyName = JsonProperties.Fingerprints, Required = Required.Always)]
[JsonPropertyName(JsonProperties.Fingerprints)]
public Fingerprints Fingerprints { get; private set; } = null!;
[JsonProperty(PropertyName = JsonProperties.Subject, Required = Required.Always)]
[JsonPropertyName(JsonProperties.Subject)]
public string Subject { get; private set; } = null!;
[JsonProperty(PropertyName = JsonProperties.Issuer, Required = Required.Always)]
[JsonPropertyName(JsonProperties.Issuer)]
public string Issuer { get; private set; } = null!;
[JsonProperty(PropertyName = JsonProperties.NotBefore, Required = Required.Always)]
[JsonPropertyName(JsonProperties.NotBefore)]
public DateTimeOffset NotBefore { get; private set; }
[JsonProperty(PropertyName = JsonProperties.NotAfter, Required = Required.Always)]
[JsonPropertyName(JsonProperties.NotAfter)]
public DateTimeOffset NotAfter { get; private set; }
[JsonProperty(PropertyName = JsonProperties.ContentUrl, Required = Required.Always)]
[JsonPropertyName(JsonProperties.ContentUrl)]
public string ContentUrl { get; private set; } = null!;
public RepositoryCertificateInfo() { }
[System.Text.Json.Serialization.JsonConstructor]
internal RepositoryCertificateInfo(
Fingerprints fingerprints,
string subject,
string issuer,
DateTimeOffset notBefore,
DateTimeOffset notAfter,
string contentUrl)
{
Fingerprints = fingerprints;
Subject = subject;
Issuer = issuer;
NotBefore = notBefore;
NotAfter = notAfter;
ContentUrl = contentUrl;
}
}
}