176 references to SR
System.Security.Cryptography.Cose (176)
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 (5)
180
=> throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, alg));
183
=> throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, BigInteger.MinusOne - new BigInteger(alg)));
193
throw new CryptographicException(
SR
.Sign1VerifyAlgIsRequired);
System\Security\Cryptography\Cose\CoseKey.cs (29)
78
_ => throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, untrustedAlgorithm))
91
_ => throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, untrustedAlgorithm))
102
_ => throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, untrustedAlgorithm))
106
=> key.Algorithm.Name == expected.Name ? new CoseKey(key) : throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, untrustedAlgorithm));
111
throw new ArgumentException(
SR
.Format(
SR
.Sign1UnsupportedKey, key.GetType().Name), nameof(key));
119
throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, alg));
144
throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, alg));
168
_ => throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, algString))
186
throw new CryptographicException(
SR
.Format(
SR
.Sign1UnsupportedKey, KeyType.ToString()));
211
throw new CryptographicException(
SR
.Format(
SR
.Sign1UnsupportedKey, KeyType.ToString()));
263
throw new ArgumentException(
SR
.Sign1UnsupportedKey, KeyType.ToString());
279
_ => throw new ArgumentException(
SR
.Format(
SR
.Sign1SignUnsupportedHashAlgorithm, hashAlgorithm.Name), nameof(hashAlgorithm))
290
_ => throw new ArgumentException(
SR
.Format(
SR
.Sign1SignUnsupportedHashAlgorithm, hashAlgorithm.Name), nameof(hashAlgorithm))
301
_ => throw new ArgumentException(
SR
.Format(
SR
.Sign1SignUnsupportedHashAlgorithm, hashAlgorithm.Name), nameof(hashAlgorithm))
322
throw new ArgumentException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, algorithm.Name), "key");
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));
575
throw new InvalidOperationException(
SR
.Sign1SignHeaderDuplicateLabels);
580
throw new InvalidOperationException(
SR
.MultiSignMessageMustCarryAtLeastOneSignature);
609
throw new InvalidOperationException(
SR
.Sign1SignHeaderDuplicateLabels);
671
throw new InvalidOperationException(
SR
.ContentWasDetached);
724
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
757
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
833
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
System\Security\Cryptography\Cose\CoseSign1Message.cs (30)
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));
391
throw new InvalidOperationException(
SR
.ContentWasDetached);
434
throw new InvalidOperationException(
SR
.ContentWasDetached);
477
throw new InvalidOperationException(
SR
.ContentWasDetached);
519
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
600
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
643
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
693
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
698
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
703
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
755
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
760
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
765
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
779
throw new CryptographicException(
SR
.Sign1VerifyAlgHeaderWasIncorrect);
784
throw new CryptographicException(
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, nullableAlg));
860
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
865
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
870
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
922
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
927
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
932
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
1006
throw new InvalidOperationException(
SR
.Sign1SignHeaderDuplicateLabels);
1046
throw new CryptographicException(
SR
.Sign1VerifyAlgHeaderWasIncorrect);
System\Security\Cryptography\Cose\CoseSignature.cs (19)
106
throw new InvalidOperationException(
SR
.ContentWasDetached);
149
throw new InvalidOperationException(
SR
.ContentWasDetached);
189
throw new InvalidOperationException(
SR
.ContentWasDetached);
235
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
316
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
360
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
411
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
416
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
421
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
473
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
478
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
483
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
534
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
539
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
544
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
598
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotReadable, nameof(detachedContent));
603
throw new ArgumentException(
SR
.Sign1ArgumentStreamNotSeekable, nameof(detachedContent));
608
throw new InvalidOperationException(
SR
.ContentWasEmbedded);
683
throw new CryptographicException(
SR
.Sign1VerifyAlgHeaderWasIncorrect);
System\Security\Cryptography\Cose\CoseSigner.cs (10)
76
throw new ArgumentException(
SR
.CoseSignerRSAKeyNeedsPadding, nameof(key));
79
throw new ArgumentException(
SR
.Format(
SR
.Sign1UnsupportedKey, key.GetType().Name), nameof(key));
167
throw new ArgumentException(
SR
.Sign1SignAlgMustBeProtected, "unprotectedHeaders");
184
exMsg =
SR
.Format(
SR
.Sign1SignCoseAlgorithmDoesNotMatchSpecifiedKeyHashAlgorithmAndPadding, alg.Value, CoseKey.KeyType, HashAlgorithm.Name, RSASignaturePadding);
188
exMsg =
SR
.Format(
SR
.Sign1UnknownCoseAlgorithm, alg.Value);
192
exMsg =
SR
.Format(
SR
.Sign1SignCoseAlgorithmDoesNotMatchSpecifiedKeyAndHashAlgorithm, alg.Value, CoseKey.KeyType, HashAlgorithm.Name);