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)
303
CborReaderState.UnsignedInteger or CborReaderState.NegativeInteger => new
CoseHeaderLabel
(reader.ReadInt32()),
304
CborReaderState.TextString => new
CoseHeaderLabel
(reader.ReadTextString()),
574
CborReaderState.UnsignedInteger or CborReaderState.NegativeInteger => new
CoseHeaderLabel
(reader.ReadInt32()),
575
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.
77
public bool Equals(
CoseHeaderLabel
other)
86
/// <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>
87
public override bool Equals([NotNullWhen(true)] object? obj) => obj is
CoseHeaderLabel
otherObj && Equals(otherObj);
113
public static bool operator ==(
CoseHeaderLabel
left,
CoseHeaderLabel
right) => left.Equals(right);
121
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)
301
CoseHeaderLabel
label = reader.PeekState() switch
546
foreach (KeyValuePair<
CoseHeaderLabel
, CoseHeaderValue> kvp in protectedHeaders)
560
!protectedHeders.TryGetValue(
CoseHeaderLabel
.CriticalHeaders, out CoseHeaderValue critHeaderValue))
572
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.
95
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
126
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
153
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
183
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
249
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
316
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
344
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
645
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
664
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
696
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
723
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
759
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
835
/// 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.
76
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
104
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
129
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
158
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
212
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
260
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
282
/// One or more of the labels specified in a <see cref="
CoseHeaderLabel
.CriticalHeaders"/> header is missing.
377
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
419
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
463
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
511
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
563
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
664
/// <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.
126
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
170
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
219
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
271
/// <see cref="CoseMessage.ProtectedHeaders"/> does not have a value for the <see cref="
CoseHeaderLabel
.Algorithm"/> header.
339
/// <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.
93
/// <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"/>.
97
/// <paramref name="unprotectedHeaders"/> specifies a value with the <see cref="
CoseHeaderLabel
.Algorithm"/> label.
140
if (_protectedHeaders != null && _protectedHeaders.TryGetValue(
CoseHeaderLabel
.Algorithm, out CoseHeaderValue value))
146
if (_unprotectedHeaders != null && _unprotectedHeaders.ContainsKey(
CoseHeaderLabel
.Algorithm))