1 instantiation of CoseHeaderValue
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHeaderValue.cs (1)
28
CoseHeaderValue value = new
CoseHeaderValue
(encodedValue);
59 references to CoseHeaderValue
System.Security.Cryptography.Cose (59)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (31)
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;
49
public ICollection<
CoseHeaderValue
> Values => _headerParameters.Values;
58
IEnumerable<CoseHeaderLabel> IReadOnlyDictionary<CoseHeaderLabel,
CoseHeaderValue
>.Keys => _headerParameters.Keys;
61
IEnumerable<
CoseHeaderValue
> IReadOnlyDictionary<CoseHeaderLabel,
CoseHeaderValue
>.Values => _headerParameters.Values;
69
/// <exception cref="ArgumentException">The property is set and the encoded bytes in the specified <see cref="
CoseHeaderValue
"/> contain trailing data or more than one CBOR value.</exception>
71
public
CoseHeaderValue
this[CoseHeaderLabel key]
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));
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()
231
public bool Remove(KeyValuePair<CoseHeaderLabel,
CoseHeaderValue
> item)
245
private static void ValidateInsertion(CoseHeaderLabel label,
CoseHeaderValue
value)
358
foreach (KeyValuePair<CoseHeaderLabel,
CoseHeaderValue
> kvp in map)
361
CoseHeaderValue
value = kvp.Value;
399
foreach (KeyValuePair<CoseHeaderLabel,
CoseHeaderValue
> kvp in map)
402
CoseHeaderValue
value = kvp.Value;
System\Security\Cryptography\Cose\CoseHeaderValue.cs (22)
12
public readonly struct CoseHeaderValue : IEquatable<
CoseHeaderValue
>
25
private static
CoseHeaderValue
FromEncodedValue(ReadOnlyMemory<byte> encodedValue)
28
CoseHeaderValue
value = new CoseHeaderValue(encodedValue);
33
/// Creates a <see cref="
CoseHeaderValue
"/> instance from a CBOR-encoded value.
37
public static
CoseHeaderValue
FromEncodedValue(ReadOnlySpan<byte> encodedValue)
44
/// Creates a <see cref="
CoseHeaderValue
"/> instance from a CBOR-encoded value.
49
public static
CoseHeaderValue
FromEncodedValue(byte[] encodedValue)
68
/// Creates a <see cref="
CoseHeaderValue
"/> instance from a signed integer.
72
public static
CoseHeaderValue
FromInt32(int value)
81
/// Creates a <see cref="
CoseHeaderValue
"/> instance from a string.
86
public static
CoseHeaderValue
FromString(string value)
100
/// Creates a <see cref="
CoseHeaderValue
"/> instance from a span of bytes.
105
public static
CoseHeaderValue
FromBytes(ReadOnlySpan<byte> value)
114
/// Creates a <see cref="
CoseHeaderValue
"/> instance from a byte array.
120
public static
CoseHeaderValue
FromBytes(byte[] value)
248
public override bool Equals([NotNullWhen(true)] object? obj) => obj is
CoseHeaderValue
otherObj && Equals(otherObj);
254
/// <returns><see langword="true"/> if value is an instance of <see cref="
CoseHeaderValue
"/> and equals the value of this instance; otherwise, <see langword="false"/>.</returns>
255
public bool Equals(
CoseHeaderValue
other) => EncodedValue.Span.SequenceEqual(other.EncodedValue.Span);
281
public static bool operator ==(
CoseHeaderValue
left,
CoseHeaderValue
right) => left.Equals(right);
289
public static bool operator !=(
CoseHeaderValue
left,
CoseHeaderValue
right) => !left.Equals(right);
System\Security\Cryptography\Cose\CoseHelpers.cs (1)
313
if (!protectedHeaders.TryGetValue(CoseHeaderLabel.Algorithm, out
CoseHeaderValue
value))
System\Security\Cryptography\Cose\CoseMessage.cs (4)
308
CoseHeaderValue
value =
CoseHeaderValue
.FromEncodedValue(reader.ReadEncodedValue().Span);
546
foreach (KeyValuePair<CoseHeaderLabel,
CoseHeaderValue
> kvp in protectedHeaders)
560
!protectedHeders.TryGetValue(CoseHeaderLabel.CriticalHeaders, out
CoseHeaderValue
critHeaderValue))
System\Security\Cryptography\Cose\CoseSigner.cs (1)
140
if (_protectedHeaders != null && _protectedHeaders.TryGetValue(CoseHeaderLabel.Algorithm, out
CoseHeaderValue
value))