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)
303CborReaderState.UnsignedInteger or CborReaderState.NegativeInteger => new CoseHeaderLabel(reader.ReadInt32()), 304CborReaderState.TextString => new CoseHeaderLabel(reader.ReadTextString()), 574CborReaderState.UnsignedInteger or CborReaderState.NegativeInteger => new CoseHeaderLabel(reader.ReadInt32()), 575CborReaderState.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. 77public 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> 87public override bool Equals([NotNullWhen(true)] object? obj) => obj is CoseHeaderLabel otherObj && Equals(otherObj); 113public static bool operator ==(CoseHeaderLabel left, CoseHeaderLabel right) => left.Equals(right); 121public 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)
301CoseHeaderLabel label = reader.PeekState() switch 546foreach (KeyValuePair<CoseHeaderLabel, CoseHeaderValue> kvp in protectedHeaders) 560!protectedHeders.TryGetValue(CoseHeaderLabel.CriticalHeaders, out CoseHeaderValue critHeaderValue)) 572CoseHeaderLabel 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. 140if (_protectedHeaders != null && _protectedHeaders.TryGetValue(CoseHeaderLabel.Algorithm, out CoseHeaderValue value)) 146if (_unprotectedHeaders != null && _unprotectedHeaders.ContainsKey(CoseHeaderLabel.Algorithm))