8 instantiations of CoseHeaderLabel
System.Security.Cryptography.Cose (8)
System\Security\Cryptography\Cose\CoseHeaderLabel.cs (4)
23
public static CoseHeaderLabel Algorithm => new
CoseHeaderLabel
(KnownHeaders.Alg);
28
public static CoseHeaderLabel CriticalHeaders => new
CoseHeaderLabel
(KnownHeaders.Crit);
33
public static CoseHeaderLabel ContentType => new
CoseHeaderLabel
(KnownHeaders.ContentType);
38
public static CoseHeaderLabel KeyIdentifier => new
CoseHeaderLabel
(KnownHeaders.Kid);
System\Security\Cryptography\Cose\CoseMessage.cs (4)
301
CborReaderState.UnsignedInteger or CborReaderState.NegativeInteger => new
CoseHeaderLabel
(reader.ReadInt32()),
302
CborReaderState.TextString => new
CoseHeaderLabel
(reader.ReadTextString()),
572
CborReaderState.UnsignedInteger or CborReaderState.NegativeInteger => new
CoseHeaderLabel
(reader.ReadInt32()),
573
CborReaderState.TextString => new
CoseHeaderLabel
(reader.ReadTextString()),
95 references to CoseHeaderLabel
System.Security.Cryptography.Cose (95)
System\Security\Cryptography\Cose\CoseHeaderLabel.cs (14)
13
public readonly struct CoseHeaderLabel : IEquatable<
CoseHeaderLabel
>
23
public static
CoseHeaderLabel
Algorithm => new CoseHeaderLabel(KnownHeaders.Alg);
28
public static
CoseHeaderLabel
CriticalHeaders => new CoseHeaderLabel(KnownHeaders.Crit);
33
public static
CoseHeaderLabel
ContentType => new CoseHeaderLabel(KnownHeaders.ContentType);
38
public static
CoseHeaderLabel
KeyIdentifier => new CoseHeaderLabel(KnownHeaders.Kid);
45
/// Initializes a new instance of the <see cref="
CoseHeaderLabel
"/> struct.
56
/// Initializes a new instance of the <see cref="
CoseHeaderLabel
"/> struct.
74
public bool Equals(
CoseHeaderLabel
other)
83
/// <returns><see langword="true"/> if value is an instance of <see cref="
CoseHeaderLabel
"/> and equals the value of this instance; otherwise, <see langword="false"/>.</returns>
84
public override bool Equals([NotNullWhen(true)] object? obj) => obj is
CoseHeaderLabel
otherObj && Equals(otherObj);
110
public static bool operator ==(
CoseHeaderLabel
left,
CoseHeaderLabel
right) => left.Equals(right);
118
public static bool operator !=(
CoseHeaderLabel
left,
CoseHeaderLabel
right) => !left.Equals(right);
System\Security\Cryptography\Cose\CoseHeaderMap.cs (36)
14
public sealed class CoseHeaderMap : IDictionary<
CoseHeaderLabel
, CoseHeaderValue>, IReadOnlyDictionary<
CoseHeaderLabel
, CoseHeaderValue>
18
private readonly Dictionary<
CoseHeaderLabel
, CoseHeaderValue> _headerParameters = new Dictionary<
CoseHeaderLabel
, CoseHeaderValue>();
37
private ICollection<KeyValuePair<
CoseHeaderLabel
, CoseHeaderValue>> HeaderParametersAsCollection => _headerParameters;
43
public ICollection<
CoseHeaderLabel
> Keys => _headerParameters.Keys;
58
IEnumerable<
CoseHeaderLabel
> IReadOnlyDictionary<
CoseHeaderLabel
, CoseHeaderValue>.Keys => _headerParameters.Keys;
61
IEnumerable<CoseHeaderValue> IReadOnlyDictionary<
CoseHeaderLabel
, CoseHeaderValue>.Values => _headerParameters.Values;
71
public CoseHeaderValue this[
CoseHeaderLabel
key]
89
public int GetValueAsInt32(
CoseHeaderLabel
label) => _headerParameters[label].GetValueAsInt32();
98
public string GetValueAsString(
CoseHeaderLabel
label) => _headerParameters[label].GetValueAsString();
106
public byte[] GetValueAsBytes(
CoseHeaderLabel
label) => _headerParameters[label].GetValueAsBytes();
117
public int GetValueAsBytes(
CoseHeaderLabel
label, Span<byte> destination) => _headerParameters[label].GetValueAsBytes(destination);
126
public void Add(
CoseHeaderLabel
key, CoseHeaderValue value)
139
public void Add(KeyValuePair<
CoseHeaderLabel
, CoseHeaderValue> item) => Add(item.Key, item.Value);
147
public void Add(
CoseHeaderLabel
label, int value) => Add(label, CoseHeaderValue.FromInt32(value));
155
public void Add(
CoseHeaderLabel
label, string value) => Add(label, CoseHeaderValue.FromString(value));
165
/// To specify a CBOR-encoded value directly, see <see cref="CoseHeaderValue.FromEncodedValue(ReadOnlySpan{byte})"/> and <see cref="Add(
CoseHeaderLabel
, CoseHeaderValue)"/>.
167
public void Add(
CoseHeaderLabel
label, byte[] value) => Add(label, CoseHeaderValue.FromBytes(value));
177
/// To specify a CBOR-encoded value directly, see <see cref="CoseHeaderValue.FromEncodedValue(ReadOnlySpan{byte})"/> and <see cref="Add(
CoseHeaderLabel
, CoseHeaderValue)"/>.
179
public void Add(
CoseHeaderLabel
label, ReadOnlySpan<byte> value) => Add(label, CoseHeaderValue.FromBytes(value));
182
public bool ContainsKey(
CoseHeaderLabel
key) => _headerParameters.ContainsKey(key);
185
public bool TryGetValue(
CoseHeaderLabel
key, out CoseHeaderValue value) => _headerParameters.TryGetValue(key, out value);
198
public bool Contains(KeyValuePair<
CoseHeaderLabel
, CoseHeaderValue> item)
202
public void CopyTo(KeyValuePair<
CoseHeaderLabel
, CoseHeaderValue>[] array, int arrayIndex)
206
public IEnumerator<KeyValuePair<
CoseHeaderLabel
, CoseHeaderValue>> GetEnumerator()
219
public bool Remove(
CoseHeaderLabel
label)
231
public bool Remove(KeyValuePair<
CoseHeaderLabel
, CoseHeaderValue> item)
245
private static void ValidateInsertion(
CoseHeaderLabel
label, CoseHeaderValue value)
353
Debug.Assert(!map.ContainsKey(
CoseHeaderLabel
.Algorithm));
358
foreach (KeyValuePair<
CoseHeaderLabel
, CoseHeaderValue> kvp in map)
360
CoseHeaderLabel
label = kvp.Key;
393
encodedSize +=
CoseHeaderLabel
.Algorithm.EncodedSize;
399
foreach (KeyValuePair<
CoseHeaderLabel
, CoseHeaderValue> kvp in map)
401
CoseHeaderLabel
label = kvp.Key;
System\Security\Cryptography\Cose\CoseHelpers.cs (1)
313
if (!protectedHeaders.TryGetValue(
CoseHeaderLabel
.Algorithm, out CoseHeaderValue value))
System\Security\Cryptography\Cose\CoseMessage.cs (4)
299
CoseHeaderLabel
label = reader.PeekState() switch
544
foreach (KeyValuePair<
CoseHeaderLabel
, CoseHeaderValue> kvp in protectedHeaders)
558
!protectedHeders.TryGetValue(
CoseHeaderLabel
.CriticalHeaders, out CoseHeaderValue critHeaderValue))
570
CoseHeaderLabel
label = reader.PeekState() switch
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (14)
64
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
94
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
124
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
151
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
181
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
245
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
309
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
337
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
637
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
656
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
685
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
709
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
742
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
815
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
System\Security\Cryptography\Cose\CoseSign1Message.cs (14)
48
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
73
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
98
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
122
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
150
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
201
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
246
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
268
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
362
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
401
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
442
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
484
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
533
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
628
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
System\Security\Cryptography\Cose\CoseSignature.cs (6)
83
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
123
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
164
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
207
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
256
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
318
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
System\Security\Cryptography\Cose\CoseSigner.cs (6)
54
/// <paramref name="protectedHeaders"/> contains a value with the <see cref="
CoseHeaderLabel
.Algorithm"/> label, but the value was incorrect based on the <paramref name="key"/> and <paramref name="hashAlgorithm"/>.
58
/// <paramref name="unprotectedHeaders"/> specifies a value with the <see cref="
CoseHeaderLabel
.Algorithm"/> label.
92
/// <paramref name="protectedHeaders"/> contains a value with the <see cref="
CoseHeaderLabel
.Algorithm"/> label, but the value was incorrect based on the <paramref name="key"/>, <paramref name="signaturePadding"/> and <paramref name="hashAlgorithm"/>.
96
/// <paramref name="unprotectedHeaders"/> specifies a value with the <see cref="
CoseHeaderLabel
.Algorithm"/> label.
136
if (_protectedHeaders != null && _protectedHeaders.TryGetValue(
CoseHeaderLabel
.Algorithm, out CoseHeaderValue value))
142
if (_unprotectedHeaders != null && _unprotectedHeaders.ContainsKey(
CoseHeaderLabel
.Algorithm))