-
Notifications
You must be signed in to change notification settings - Fork 401
/
JwtHeaderParameterNames.cs
115 lines (96 loc) · 4.29 KB
/
JwtHeaderParameterNames.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
namespace Microsoft.IdentityModel.JsonWebTokens
{
/// <summary>
/// Defines JOSE header parameter names. See: <see href="https://datatracker.ietf.org/doc/html/rfc7519#section-5"/>.
/// </summary>
public struct JwtHeaderParameterNames
{
// Please keep this alphabetical order
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.1"/>.
/// </summary>
public const string Alg = "alg";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7518#section-4.6.1.2"/>.
/// </summary>
public const string Apu = "apu";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7518#section-4.6.1.3"/>.
/// </summary>
public const string Apv = "apv";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7518#section-4.6.1.1"/>.
/// </summary>
public const string Epk = "epk";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.10"/> and <see href="https://datatracker.ietf.org/doc/html/rfc7519#section-5.2"/>.
/// </summary>
public const string Cty = "cty";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7516#section-4.1.2"/>.
/// </summary>
public const string Enc = "enc";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7518#section-4.7.1.1"/>.
/// </summary>
public const string IV = "iv";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.2"/>.
/// </summary>
public const string Jku = "jku";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.3"/>.
/// </summary>
public const string Jwk = "jwk";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.4"/>.
/// </summary>
public const string Kid = "kid";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.9"/> and <see href="https://datatracker.ietf.org/doc/html/rfc7519#section-5.1"/>.
/// </summary>
public const string Typ = "typ";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.6"/>.
/// </summary>
public const string X5c = "x5c";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7515#page-12"/>.
/// </summary>
public const string X5t = "x5t";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.5"/>.
/// </summary>
public const string X5u = "x5u";
/// <summary>
/// See: <see href="https://datatracker.ietf.org/doc/html/rfc7516#section-4.1.3"/>.
/// </summary>
public const string Zip = "zip";
}
/// <summary>
/// Parameter names for JsonWebToken header values as UTF8 bytes.
/// Used by UTF8JsonReader/Writer for performance gains.
/// </summary>
internal readonly struct JwtHeaderUtf8Bytes
{
// Please keep this alphabetical order
public static ReadOnlySpan<byte> Alg => "alg"u8;
public static ReadOnlySpan<byte> Apu => "apu"u8;
public static ReadOnlySpan<byte> Apv => "apv"u8;
public static ReadOnlySpan<byte> Cty => "cty"u8;
public static ReadOnlySpan<byte> Enc => "enc"u8;
public static ReadOnlySpan<byte> Epk => "epk"u8;
public static ReadOnlySpan<byte> IV => "iv"u8;
public static ReadOnlySpan<byte> Jku => "jku"u8;
public static ReadOnlySpan<byte> Jwk => "jwk"u8;
public static ReadOnlySpan<byte> Kid => "kid"u8;
public static ReadOnlySpan<byte> Typ => "typ"u8;
public static ReadOnlySpan<byte> X5c => "x5c"u8;
public static ReadOnlySpan<byte> X5t => "x5t"u8;
public static ReadOnlySpan<byte> X5u => "x5u"u8;
public static ReadOnlySpan<byte> Zip => "zip"u8;
}
}