/
CngUIPolicy.cs
69 lines (58 loc) · 2.53 KB
/
CngUIPolicy.cs
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
60
61
62
63
64
65
66
67
68
69
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Diagnostics;
namespace System.Security.Cryptography
{
/// <summary>
/// Configuration parameters for the UI displayed by CNG when accessing a protected key
/// </summary>
public sealed class CngUIPolicy
{
public CngUIPolicy(CngUIProtectionLevels protectionLevel)
: this(protectionLevel, friendlyName: null)
{
}
public CngUIPolicy(CngUIProtectionLevels protectionLevel, string? friendlyName)
: this(protectionLevel, friendlyName, description: null)
{
}
public CngUIPolicy(CngUIProtectionLevels protectionLevel, string? friendlyName, string? description)
: this(protectionLevel, friendlyName, description, useContext: null)
{
}
public CngUIPolicy(CngUIProtectionLevels protectionLevel, string? friendlyName, string? description, string? useContext)
: this(protectionLevel, friendlyName, description, useContext, creationTitle: null)
{
}
public CngUIPolicy(CngUIProtectionLevels protectionLevel, string? friendlyName, string? description, string? useContext, string? creationTitle)
{
ProtectionLevel = protectionLevel;
FriendlyName = friendlyName;
Description = description;
UseContext = useContext;
CreationTitle = creationTitle;
}
/// <summary>
/// Level of UI protection to apply to the key
/// </summary>
public CngUIProtectionLevels ProtectionLevel { get; private set; }
/// <summary>
/// Friendly name to describe the key with in the dialog box that appears when the key is accessed,
/// null for default name
/// </summary>
public string? FriendlyName { get; private set; }
/// <summary>
/// Description text displayed in the dialog box when the key is accessed, null for the default text
/// </summary>
public string? Description { get; private set; }
/// <summary>
/// Description of how the key will be used
/// </summary>
public string? UseContext { get; private set; }
/// <summary>
/// Title of the dialog box displayed when a newly created key is finalized, null for the default title
/// </summary>
public string? CreationTitle { get; private set; }
}
}