142 references to SR
System.Security.Cryptography.Cose (142)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (13)
241
throw new InvalidOperationException(
SR
.CoseHeaderMapDecodedMapIsReadOnlyCannotSetValue);
264
throw new ArgumentException(
SR
.Format(
SR
.CoseHeaderMapHeaderDoesNotAcceptSpecifiedValue, label.LabelName), nameof(value));
290
throw new ArgumentException(
SR
.Format(
SR
.CoseHeaderMapHeaderDoesNotAcceptSpecifiedValue, label.LabelName), nameof(value));
297
throw new ArgumentException(
SR
.CriticalHeadersMustBeArrayOfAtLeastOne, nameof(value));
304
throw new ArgumentException(
SR
.Format(
SR
.CoseHeaderMapHeaderDoesNotAcceptSpecifiedValue, label.LabelName), nameof(value));
311
throw new ArgumentException(
SR
.Format(
SR
.CoseHeaderMapHeaderDoesNotAcceptSpecifiedValue, label.LabelName), nameof(value));
323
throw new CborContentException(
SR
.CoseHeaderMapCborEncodedValueNotValid);
328
throw new ArgumentException(
SR
.Format(
SR
.CoseHeaderMapArgumentCoseHeaderValueIncorrect, label.LabelName), nameof(value), ex);
System\Security\Cryptography\Cose\CoseHeaderValue.cs (13)
137
throw new InvalidOperationException(
SR
.CoseHeaderValueErrorWhileDecoding, ex);
142
throw new InvalidOperationException(
SR
.Format(
SR
.CoseHeaderMapCborEncodedValueNotValid));
164
throw new InvalidOperationException(
SR
.CoseHeaderValueErrorWhileDecoding, ex);
169
throw new InvalidOperationException(
SR
.Format(
SR
.CoseHeaderMapCborEncodedValueNotValid));
191
throw new InvalidOperationException(
SR
.CoseHeaderValueErrorWhileDecoding, ex);
196
throw new InvalidOperationException(
SR
.Format(
SR
.CoseHeaderMapCborEncodedValueNotValid));
218
throw new ArgumentException(
SR
.Argument_DestinationTooSmall, nameof(destination));
223
throw new InvalidOperationException(
SR
.CoseHeaderValueErrorWhileDecoding, ex);
228
throw new InvalidOperationException(
SR
.Format(
SR
.CoseHeaderMapCborEncodedValueNotValid));
System\Security\Cryptography\Cose\CoseHelpers.cs (7)
269
_ => throw new CryptographicException(
SR
.Format(
SR
.Sign1AlgDoesNotMatchWithTheOnesSupportedByTypeOfKey, algorithm, typeof(ECDsa)))
280
_ => throw new CryptographicException(
SR
.Format(
SR
.Sign1AlgDoesNotMatchWithTheOnesSupportedByTypeOfKey, algorithm, typeof(RSA)))
304
_ => throw new ArgumentException(
SR
.Format(
SR
.Sign1UnsupportedKey, key.GetType()), nameof(key))
315
throw new CryptographicException(
SR
.Sign1VerifyAlgIsRequired);
System\Security\Cryptography\Cose\CoseMessage.cs (40)
127
throw new CryptographicException(
SR
.Format(
SR
.DecodeSign1IncorrectTag, tag));
134
throw new CryptographicException(
SR
.Format(
SR
.DecodeErrorWhileDecoding,
SR
.DecodeMessageContainedTrailingData));
143
throw new CryptographicException(
SR
.Format(
SR
.DecodeErrorWhileDecoding,
SR
.DecodeSign1ArrayLengthMustBeFour));
154
throw new CryptographicException(
SR
.Sign1SignHeaderDuplicateLabels);
167
throw new CryptographicException(
SR
.DecodeErrorWhileDecodingSeeInnerEx, ex);
212
throw new CryptographicException(
SR
.Format(
SR
.DecodeMultiSignIncorrectTag, tag));
219
throw new CryptographicException(
SR
.Format(
SR
.DecodeErrorWhileDecoding,
SR
.DecodeMessageContainedTrailingData));
228
throw new CryptographicException(
SR
.Format(
SR
.DecodeErrorWhileDecoding,
SR
.DecodeMultiSignArrayLengthMustBeFour));
239
throw new CryptographicException(
SR
.Sign1SignHeaderDuplicateLabels);
252
throw new CryptographicException(
SR
.DecodeErrorWhileDecodingSeeInnerEx, ex);
278
throw new CryptographicException(
SR
.Format(
SR
.CriticalHeaderMissing, labelName));
285
throw new CryptographicException(
SR
.Format(
SR
.DecodeErrorWhileDecoding,
SR
.DecodeSign1EncodedProtectedMapIncorrect));
303
_ => throw new CryptographicException(
SR
.Format(
SR
.DecodeErrorWhileDecoding,
SR
.DecodeSign1MapLabelWasIncorrect))
325
throw new CryptographicException(
SR
.Format(
SR
.DecodeErrorWhileDecoding,
SR
.DecodeSign1PayloadWasIncorrect));
348
throw new CryptographicException(
SR
.Format(
SR
.DecodeErrorWhileDecoding,
SR
.MultiSignMessageMustCarryAtLeastOneSignature));
362
throw new CryptographicException(
SR
.Format(
SR
.DecodeErrorWhileDecoding,
SR
.DecodeCoseSignatureMustBeArrayOfThree));
373
throw new CryptographicException(
SR
.Sign1SignHeaderDuplicateLabels);
574
_ => throw new CryptographicException(
SR
.CriticalHeadersLabelWasIncorrect)
615
throw new ArgumentException(
SR
.Argument_EncodeDestinationTooSmall, nameof(destination));
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (17)
190
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
193
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
260
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
263
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
418
throw new ArgumentException(
SR
.Sign1SignHeaderDuplicateLabels, nameof(signer));
423
throw new ArgumentException(
SR
.Sign1SignHeaderDuplicateLabels);
428
throw new ArgumentException(
SR
.Format(
SR
.CriticalHeaderMissing, labelName), nameof(signer));
433
throw new ArgumentException(
SR
.Format(
SR
.CriticalHeaderMissing, labelName), nameof(protectedHeaders));
570
throw new InvalidOperationException(
SR
.Sign1SignHeaderDuplicateLabels);
575
throw new InvalidOperationException(
SR
.MultiSignMessageMustCarryAtLeastOneSignature);
604
throw new InvalidOperationException(
SR
.Sign1SignHeaderDuplicateLabels);
666
throw new InvalidOperationException(
SR
.ContentWasDetached);
719
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
752
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
825
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
System\Security\Cryptography\Cose\CoseSign1Message.cs (20)
159
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
162
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
210
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
213
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
297
throw new ArgumentException(
SR
.Sign1SignHeaderDuplicateLabels, nameof(signer));
302
throw new ArgumentException(
SR
.Format(
SR
.CriticalHeaderMissing, labelName), nameof(signer));
385
throw new InvalidOperationException(
SR
.ContentWasDetached);
424
throw new InvalidOperationException(
SR
.ContentWasDetached);
466
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
507
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
557
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
562
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
567
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
581
throw new CryptographicException(
SR
.Sign1VerifyAlgHeaderWasIncorrect);
652
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
657
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
662
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
675
throw new CryptographicException(
SR
.Sign1VerifyAlgHeaderWasIncorrect);
764
throw new InvalidOperationException(
SR
.Sign1SignHeaderDuplicateLabels);
System\Security\Cryptography\Cose\CoseSignature.cs (12)
106
throw new InvalidOperationException(
SR
.ContentWasDetached);
146
throw new InvalidOperationException(
SR
.ContentWasDetached);
189
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
230
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
281
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
286
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
291
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
342
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
347
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
352
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
365
throw new CryptographicException(
SR
.Sign1VerifyAlgHeaderWasIncorrect);
398
throw new CryptographicException(
SR
.Sign1VerifyAlgHeaderWasIncorrect);
System\Security\Cryptography\Cose\CoseSigner.cs (12)
70
throw new ArgumentException(
SR
.CoseSignerRSAKeyNeedsPadding, nameof(key));
144
throw new ArgumentException(
SR
.Sign1SignAlgMustBeProtected, "unprotectedHeaders");
160
exMsg =
SR
.Format(
SR
.Sign1SignCoseAlgorithmDoesNotMatchSpecifiedKeyHashAlgorithmAndPadding, alg.Value, _keyType, HashAlgorithm.Name, RSASignaturePadding);
164
exMsg =
SR
.Format(
SR
.Sign1SignCoseAlgorithmDoesNotMatchSpecifiedKeyAndHashAlgorithm, alg.Value, _keyType, HashAlgorithm.Name);
181
_ => throw new ArgumentException(
SR
.Format(
SR
.Sign1SignUnsupportedHashAlgorithm, hashAlgorithmName), "hashAlgorithm")
195
_ => throw new ArgumentException(
SR
.Format(
SR
.Sign1SignUnsupportedHashAlgorithm, hashAlgorithmName), "hashAlgorithm")
206
_ => throw new ArgumentException(
SR
.Format(
SR
.Sign1SignUnsupportedHashAlgorithm, hashAlgorithmName), "hashAlgorithm")
System\Security\Cryptography\Cose\KnownCoseAlgorithms.cs (8)
30
throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, alg));
35
=> throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, alg));
38
=> throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, BigInteger.MinusOne - new BigInteger(alg)));
53
_ => throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, algString))