9 instantiations of CoseHeaderMap
System.Security.Cryptography.Cose (9)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (1)
16
private static readonly CoseHeaderMap s_emptyMap = new
CoseHeaderMap
(isReadOnly: true);
System\Security\Cryptography\Cose\CoseMessage.cs (6)
147
var protectedHeader = new
CoseHeaderMap
();
150
var unprotectedHeader = new
CoseHeaderMap
();
233
var protectedHeaders = new
CoseHeaderMap
();
236
var unprotectedHeaders = new
CoseHeaderMap
();
367
var protectedHeaders = new
CoseHeaderMap
();
370
var unprotectedHeaders = new
CoseHeaderMap
();
System\Security\Cryptography\Cose\CoseSigner.cs (2)
126
public CoseHeaderMap ProtectedHeaders => _protectedHeaders ??= new
CoseHeaderMap
();
132
public CoseHeaderMap UnprotectedHeaders => _unprotectedHeaders ??= new
CoseHeaderMap
();
91 references to CoseHeaderMap
System.Security.Cryptography.Cose (91)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (5)
16
private static readonly
CoseHeaderMap
s_emptyMap = new CoseHeaderMap(isReadOnly: true);
28
/// Initializes a new instance of the <see cref="
CoseHeaderMap
"/> class.
68
/// <exception cref="InvalidOperationException">The property is set and the <see cref="
CoseHeaderMap
"/> is read-only.</exception>
332
internal static int Encode(
CoseHeaderMap
? map, Span<byte> destination, bool isProtected = false, int? algHeaderValueToSlip = null)
382
internal static int ComputeEncodedSize(
CoseHeaderMap
? map, int? algHeaderValueToSlip = null)
System\Security\Cryptography\Cose\CoseHelpers.cs (5)
173
internal static int GetCoseSignEncodedLengthMinusSignature(bool isTagged, int sizeOfCborTag, int encodedProtectedHeadersLength,
CoseHeaderMap
unprotectedHeaders, byte[]? content)
185
retVal +=
CoseHeaderMap
.ComputeEncodedSize(unprotectedHeaders);
308
internal static ReadOnlyMemory<byte> GetCoseAlgorithmFromProtectedHeaders(
CoseHeaderMap
protectedHeaders)
321
internal static int WriteHeaderMap(Span<byte> buffer, CborWriter writer,
CoseHeaderMap
? headerMap, bool isProtected, int? algHeaderValueToSlip)
323
int bytesWritten =
CoseHeaderMap
.Encode(headerMap, buffer, isProtected, algHeaderValueToSlip);
System\Security\Cryptography\Cose\CoseMessage.cs (18)
34
private readonly
CoseHeaderMap
_protectedHeaders;
35
private readonly
CoseHeaderMap
_unprotectedHeaders;
41
public
CoseHeaderMap
ProtectedHeaders => _protectedHeaders;
47
public
CoseHeaderMap
UnprotectedHeaders => _unprotectedHeaders;
55
internal CoseMessage(
CoseHeaderMap
protectedHeader,
CoseHeaderMap
unprotectedHeader, byte[]? content, byte[] encodedProtectedHeader, bool isTagged)
147
var
protectedHeader = new CoseHeaderMap();
150
var
unprotectedHeader = new CoseHeaderMap();
233
var
protectedHeaders = new CoseHeaderMap();
236
var
unprotectedHeaders = new CoseHeaderMap();
267
private static void DecodeProtectedBucket(CborReader reader,
CoseHeaderMap
headerParameters, out byte[] protectedHeaderAsBstr)
291
private static void DecodeUnprotectedBucket(CborReader reader,
CoseHeaderMap
headerParameters)
296
private static void DecodeBucket(CborReader reader,
CoseHeaderMap
headerParameters)
367
var
protectedHeaders = new CoseHeaderMap();
370
var
unprotectedHeaders = new CoseHeaderMap();
539
internal static bool ContainDuplicateLabels(
CoseHeaderMap
? protectedHeaders,
CoseHeaderMap
? unprotectedHeaders)
557
internal static bool MissingCriticalHeaders(
CoseHeaderMap
? protectedHeders, out string? labelName)
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (43)
32
internal CoseMultiSignMessage(
CoseHeaderMap
protectedHeader,
CoseHeaderMap
unprotectedHeader, byte[]? content, List<CoseSignature> signatures, byte[] encodedProtectedHeader, bool isTagged)
67
public static byte[] SignDetached(byte[] detachedContent, CoseSigner signer,
CoseHeaderMap
? protectedHeaders = null,
CoseHeaderMap
? unprotectedHeaders = null, byte[]? associatedData = null)
98
public static byte[] SignEmbedded(byte[] embeddedContent, CoseSigner signer,
CoseHeaderMap
? protectedHeaders = null,
CoseHeaderMap
? unprotectedHeaders = null, byte[]? associatedData = null)
129
public static byte[] SignDetached(ReadOnlySpan<byte> detachedContent, CoseSigner signer,
CoseHeaderMap
? protectedHeaders = null,
CoseHeaderMap
? unprotectedHeaders = null, ReadOnlySpan<byte> associatedData = default)
156
public static byte[] SignEmbedded(ReadOnlySpan<byte> embeddedContent, CoseSigner signer,
CoseHeaderMap
? protectedHeaders = null,
CoseHeaderMap
? unprotectedHeaders = null, ReadOnlySpan<byte> associatedData = default)
187
public static byte[] SignDetached(Stream detachedContent, CoseSigner signer,
CoseHeaderMap
? protectedHeaders = null,
CoseHeaderMap
? unprotectedHeaders = null, ReadOnlySpan<byte> associatedData = default)
205
CoseHeaderMap
? protectedHeaders,
206
CoseHeaderMap
? unprotectedHeaders,
255
CoseHeaderMap
? protectedHeaders = null,
256
CoseHeaderMap
? unprotectedHeaders = null,
282
CoseHeaderMap
? protectedHeaders,
283
CoseHeaderMap
? unprotectedHeaders,
319
public static bool TrySignDetached(ReadOnlySpan<byte> detachedContent, Span<byte> destination, CoseSigner signer, out int bytesWritten,
CoseHeaderMap
? protectedHeaders = null,
CoseHeaderMap
? unprotectedHeaders = null, ReadOnlySpan<byte> associatedData = default)
347
public static bool TrySignEmbedded(ReadOnlySpan<byte> embeddedContent, Span<byte> destination, CoseSigner signer, out int bytesWritten,
CoseHeaderMap
? protectedHeaders = null,
CoseHeaderMap
? unprotectedHeaders = null, ReadOnlySpan<byte> associatedData = default)
350
private static bool TrySign(ReadOnlySpan<byte> content, Span<byte> destination, CoseSigner signer,
CoseHeaderMap
? protectedHeaders,
CoseHeaderMap
? unprotectedHeaders, out int bytesWritten, ReadOnlySpan<byte> associatedData, bool isDetached)
375
CoseHeaderMap
? protectedHeaders,
376
CoseHeaderMap
? unprotectedHeaders,
401
CoseHeaderMap
? protectedHeaders,
402
CoseHeaderMap
? unprotectedHeaders,
422
private static void ValidateBeforeSign(CoseSigner signer,
CoseHeaderMap
? protectedHeaders,
CoseHeaderMap
? unprotectedHeaders)
501
private static int ComputeEncodedSize(CoseSigner signer,
CoseHeaderMap
? protectedHeaders,
CoseHeaderMap
? unprotectedHeaders, int contentLength, bool isDetached)
506
int protectedHeadersSize =
CoseHeaderMap
.ComputeEncodedSize(protectedHeaders);
517
encodedSize +=
CoseHeaderMap
.ComputeEncodedSize(unprotectedHeaders);
530
encodedSize += CoseHelpers.GetByteStringEncodedSize(
CoseHeaderMap
.ComputeEncodedSize(signer._protectedHeaders, signer._algHeaderValueToSlip));
531
encodedSize +=
CoseHeaderMap
.ComputeEncodedSize(signer._unprotectedHeaders);
550
encodedLength +=
CoseHeaderMap
.ComputeEncodedSize(signature.UnprotectedHeaders);
782
CoseHeaderMap
signProtectedHeaders = signer.ProtectedHeaders;
784
int signProtectedEncodedLength =
CoseHeaderMap
.ComputeEncodedSize(signProtectedHeaders, algHeaderValueToSlip);
798
int bytesWritten =
CoseHeaderMap
.Encode(signProtectedHeaders, bufferSpan, isProtected: true, algHeaderValueToSlip);
858
CoseHeaderMap
signProtectedHeaders = signer.ProtectedHeaders;
860
int signProtectedEncodedLength =
CoseHeaderMap
.ComputeEncodedSize(signProtectedHeaders, algHeaderValueToSlip);
871
int bytesWritten =
CoseHeaderMap
.Encode(signProtectedHeaders, buffer, isProtected: true, algHeaderValueToSlip);
System\Security\Cryptography\Cose\CoseSign1Message.cs (4)
28
internal CoseSign1Message(
CoseHeaderMap
protectedHeader,
CoseHeaderMap
unprotectedHeader, byte[]? content, byte[] signature, byte[] protectedHeaderAsBstr, bool isTagged)
768
CoseHelpers.GetByteStringEncodedSize(
CoseHeaderMap
.ComputeEncodedSize(signer._protectedHeaders, signer._algHeaderValueToSlip)) +
769
CoseHeaderMap
.ComputeEncodedSize(signer._unprotectedHeaders);
System\Security\Cryptography\Cose\CoseSignature.cs (6)
25
public
CoseHeaderMap
ProtectedHeaders { get; }
31
public
CoseHeaderMap
UnprotectedHeaders { get; }
45
internal CoseSignature(CoseMultiSignMessage message,
CoseHeaderMap
protectedHeaders,
CoseHeaderMap
unprotectedHeaders, byte[] encodedSignProtectedHeaders, byte[] signature)
51
internal CoseSignature(
CoseHeaderMap
protectedHeaders,
CoseHeaderMap
unprotectedHeaders, byte[] encodedSignProtectedHeaders, byte[] signature)
System\Security\Cryptography\Cose\CoseSigner.cs (10)
15
internal
CoseHeaderMap
? _protectedHeaders;
16
internal
CoseHeaderMap
? _unprotectedHeaders;
46
/// <paramref name="key"/> is <see cref="RSA"/>, use <see cref="CoseSigner(RSA, RSASignaturePadding, HashAlgorithmName,
CoseHeaderMap
?,
CoseHeaderMap
?)"/> to specify a signature padding.
65
public CoseSigner(AsymmetricAlgorithm key, HashAlgorithmName hashAlgorithm,
CoseHeaderMap
? protectedHeaders = null,
CoseHeaderMap
? unprotectedHeaders = null)
104
public CoseSigner(RSA key, RSASignaturePadding signaturePadding, HashAlgorithmName hashAlgorithm,
CoseHeaderMap
? protectedHeaders = null,
CoseHeaderMap
? unprotectedHeaders = null)
126
public
CoseHeaderMap
ProtectedHeaders => _protectedHeaders ??= new CoseHeaderMap();
132
public
CoseHeaderMap
UnprotectedHeaders => _unprotectedHeaders ??= new CoseHeaderMap();