8 instantiations of CoseHeaderLabel
System.Security.Cryptography.Cose (8)
System\Security\Cryptography\Cose\CoseHeaderLabel.cs (4)
23public static CoseHeaderLabel Algorithm => new CoseHeaderLabel(KnownHeaders.Alg); 28public static CoseHeaderLabel CriticalHeaders => new CoseHeaderLabel(KnownHeaders.Crit); 33public static CoseHeaderLabel ContentType => new CoseHeaderLabel(KnownHeaders.ContentType); 38public static CoseHeaderLabel KeyIdentifier => new CoseHeaderLabel(KnownHeaders.Kid);
System\Security\Cryptography\Cose\CoseMessage.cs (4)
301CborReaderState.UnsignedInteger or CborReaderState.NegativeInteger => new CoseHeaderLabel(reader.ReadInt32()), 302CborReaderState.TextString => new CoseHeaderLabel(reader.ReadTextString()), 572CborReaderState.UnsignedInteger or CborReaderState.NegativeInteger => new CoseHeaderLabel(reader.ReadInt32()), 573CborReaderState.TextString => new CoseHeaderLabel(reader.ReadTextString()),
95 references to CoseHeaderLabel
System.Security.Cryptography.Cose (95)
System\Security\Cryptography\Cose\CoseHeaderLabel.cs (14)
13public readonly struct CoseHeaderLabel : IEquatable<CoseHeaderLabel> 23public static CoseHeaderLabel Algorithm => new CoseHeaderLabel(KnownHeaders.Alg); 28public static CoseHeaderLabel CriticalHeaders => new CoseHeaderLabel(KnownHeaders.Crit); 33public static CoseHeaderLabel ContentType => new CoseHeaderLabel(KnownHeaders.ContentType); 38public 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. 74public 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> 84public override bool Equals([NotNullWhen(true)] object? obj) => obj is CoseHeaderLabel otherObj && Equals(otherObj); 110public static bool operator ==(CoseHeaderLabel left, CoseHeaderLabel right) => left.Equals(right); 118public static bool operator !=(CoseHeaderLabel left, CoseHeaderLabel right) => !left.Equals(right);
System\Security\Cryptography\Cose\CoseHeaderMap.cs (36)
14public sealed class CoseHeaderMap : IDictionary<CoseHeaderLabel, CoseHeaderValue>, IReadOnlyDictionary<CoseHeaderLabel, CoseHeaderValue> 18private readonly Dictionary<CoseHeaderLabel, CoseHeaderValue> _headerParameters = new Dictionary<CoseHeaderLabel, CoseHeaderValue>(); 37private ICollection<KeyValuePair<CoseHeaderLabel, CoseHeaderValue>> HeaderParametersAsCollection => _headerParameters; 43public ICollection<CoseHeaderLabel> Keys => _headerParameters.Keys; 58IEnumerable<CoseHeaderLabel> IReadOnlyDictionary<CoseHeaderLabel, CoseHeaderValue>.Keys => _headerParameters.Keys; 61IEnumerable<CoseHeaderValue> IReadOnlyDictionary<CoseHeaderLabel, CoseHeaderValue>.Values => _headerParameters.Values; 71public CoseHeaderValue this[CoseHeaderLabel key] 89public int GetValueAsInt32(CoseHeaderLabel label) => _headerParameters[label].GetValueAsInt32(); 98public string GetValueAsString(CoseHeaderLabel label) => _headerParameters[label].GetValueAsString(); 106public byte[] GetValueAsBytes(CoseHeaderLabel label) => _headerParameters[label].GetValueAsBytes(); 117public int GetValueAsBytes(CoseHeaderLabel label, Span<byte> destination) => _headerParameters[label].GetValueAsBytes(destination); 126public void Add(CoseHeaderLabel key, CoseHeaderValue value) 139public void Add(KeyValuePair<CoseHeaderLabel, CoseHeaderValue> item) => Add(item.Key, item.Value); 147public void Add(CoseHeaderLabel label, int value) => Add(label, CoseHeaderValue.FromInt32(value)); 155public 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)"/>. 167public 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)"/>. 179public void Add(CoseHeaderLabel label, ReadOnlySpan<byte> value) => Add(label, CoseHeaderValue.FromBytes(value)); 182public bool ContainsKey(CoseHeaderLabel key) => _headerParameters.ContainsKey(key); 185public bool TryGetValue(CoseHeaderLabel key, out CoseHeaderValue value) => _headerParameters.TryGetValue(key, out value); 198public bool Contains(KeyValuePair<CoseHeaderLabel, CoseHeaderValue> item) 202public void CopyTo(KeyValuePair<CoseHeaderLabel, CoseHeaderValue>[] array, int arrayIndex) 206public IEnumerator<KeyValuePair<CoseHeaderLabel, CoseHeaderValue>> GetEnumerator() 219public bool Remove(CoseHeaderLabel label) 231public bool Remove(KeyValuePair<CoseHeaderLabel, CoseHeaderValue> item) 245private static void ValidateInsertion(CoseHeaderLabel label, CoseHeaderValue value) 353Debug.Assert(!map.ContainsKey(CoseHeaderLabel.Algorithm)); 358foreach (KeyValuePair<CoseHeaderLabel, CoseHeaderValue> kvp in map) 360CoseHeaderLabel label = kvp.Key; 393encodedSize += CoseHeaderLabel.Algorithm.EncodedSize; 399foreach (KeyValuePair<CoseHeaderLabel, CoseHeaderValue> kvp in map) 401CoseHeaderLabel label = kvp.Key;
System\Security\Cryptography\Cose\CoseHelpers.cs (1)
313if (!protectedHeaders.TryGetValue(CoseHeaderLabel.Algorithm, out CoseHeaderValue value))
System\Security\Cryptography\Cose\CoseMessage.cs (4)
299CoseHeaderLabel label = reader.PeekState() switch 544foreach (KeyValuePair<CoseHeaderLabel, CoseHeaderValue> kvp in protectedHeaders) 558!protectedHeders.TryGetValue(CoseHeaderLabel.CriticalHeaders, out CoseHeaderValue critHeaderValue)) 570CoseHeaderLabel 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. 136if (_protectedHeaders != null && _protectedHeaders.TryGetValue(CoseHeaderLabel.Algorithm, out CoseHeaderValue value)) 142if (_unprotectedHeaders != null && _unprotectedHeaders.ContainsKey(CoseHeaderLabel.Algorithm))