140 references to Format
System.Security.Cryptography (140)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AesGcm.cs (2)
317throw new ArgumentException(SR.Format(SR.Cryptography_IncorrectTagLength, tagSizeInBytes), nameof(tag)); 330throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(AesGcm)));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (1)
50SR.Format(SR.Cryptography_UnknownHashAlgorithm, algorithmValue));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (4)
679throw new CryptographicException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(CompositeMLDsa))); 877throw new CryptographicException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(CompositeMLDsa))); 1982throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(CompositeMLDsa))); 1990throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(CompositeMLDsa)));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLKem.cs (6)
173SR.Format(SR.Argument_DestinationImprecise, Algorithm.CiphertextSizeInBytes), 180SR.Format(SR.Argument_DestinationImprecise, Algorithm.SharedSecretSizeInBytes), 283SR.Format(SR.Argument_DestinationImprecise, Algorithm.SharedSecretSizeInBytes), 547throw new CryptographicException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(CompositeMLKem))); 646throw new CryptographicException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(CompositeMLKem))); 2253throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(CompositeMLKem)));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.HashAlgorithm.cs (1)
82throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, algorithm));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.ImportExport.NamedCurve.cs (1)
187throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, curveName), e);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanCng.ImportExport.cs (2)
42SR.Format(SR.Cryptography_InvalidCurveOid, curve.Oid.Value)); 63SR.Format(SR.Cryptography_CurveNotSupported, curve.CurveType.ToString()));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDsaCng.ImportExport.cs (2)
56throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_InvalidCurveOid, curve.Oid.Value!.ToString())); 75throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, curve.CurveType.ToString()));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (4)
138throw new CryptographicException(SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashOid)); 213throw new CryptographicException(SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithmName), ex); 231SR.Format(SR.Cryptography_UnknownAlgorithmIdentifier, algorithmId)); 284throw new ArgumentException(SR.Format(SR.Argument_DestinationImprecise, expectedLength), paramName);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (3)
322throw new CryptographicException(SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithmOid)); 2249SR.Format(SR.Cryptography_UnknownAlgorithmIdentifier, identifier.Algorithm)); 2263throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(MLDsa)));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (7)
114SR.Format(SR.Argument_DestinationImprecise, Algorithm.CiphertextSizeInBytes), 121SR.Format(SR.Argument_DestinationImprecise, Algorithm.SharedSecretSizeInBytes), 211SR.Format(SR.Argument_DestinationImprecise, Algorithm.SharedSecretSizeInBytes), 294SR.Format(SR.Argument_DestinationImprecise, Algorithm.PrivateSeedSizeInBytes), 525SR.Format(SR.Argument_DestinationImprecise, Algorithm.DecapsulationKeySizeInBytes), 579SR.Format(SR.Argument_DestinationImprecise, Algorithm.EncapsulationKeySizeInBytes), 1673throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(MLKem)));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (9)
108SR.Format( 171SR.Format( 271SR.Format( 303SR.Format( 553SR.Format( 605SR.Format(SR.Cryptography_AlgorithmNotSupported, algId)); 778SR.Format( 796SR.Format( 1148throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(RC2)));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs9AttributeObject.cs (3)
40throw new ArgumentException(SR.Format(SR.Arg_EmptyOrNullString_Named, "asnEncodedData.Oid"), nameof(asnEncodedData)); 43throw new ArgumentException(SR.Format(SR.Arg_EmptyOrNullString_Named, "oid.Value"), nameof(asnEncodedData)); 45throw new ArgumentException(SR.Format(SR.Arg_EmptyOrNullString_Named, "oid.Value"), nameof(asnEncodedData));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (2)
53SR.Format(SR.Cryptography_Encryption_MessageTooLong, modulusSizeInBytes - Pkcs1PaddingOverhead)); 135SR.Format(SR.Cryptography_Encryption_MessageTooLong, modulusSizeInBytes - Pkcs1PaddingOverhead));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (1)
311SR.Format(SR.Cryptography_Encryption_MessageTooLong, maxInput));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (5)
137SR.Format(SR.Argument_DestinationImprecise, signatureSizeInBytes), 321SR.Format(SR.Argument_DestinationImprecise, Algorithm.SignatureSizeInBytes), 1082SR.Format(SR.Argument_DestinationImprecise, publicKeySizeInBytes), 1133SR.Format(SR.Argument_DestinationImprecise, privateKeySizeInBytes), 2002throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(SlhDsa)));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsaAlgorithm.cs (1)
263SR.Format(SR.Cryptography_UnknownAlgorithmIdentifier, algorithmId));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdf.cs (1)
566throw new CryptographicException(SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithmName));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519DiffieHellman.cs (5)
152SR.Format(SR.Argument_DestinationImprecise, SecretAgreementSizeInBytes), 189SR.Format(SR.Argument_DestinationImprecise, SecretAgreementSizeInBytes), 253SR.Format(SR.Argument_DestinationImprecise, PrivateKeySizeInBytes), 298SR.Format(SR.Argument_DestinationImprecise, PublicKeySizeInBytes), 1621SR.Format(SR.Cryptography_AlgorithmNotSupported,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\Pkcs12LoadLimitExceededException.cs (1)
20: base(SR.Format(SR.Cryptography_X509_PKCS12_LimitExceeded, propertyName))
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (2)
595SR.Format( 613SR.Format(
System\Security\Cryptography\Aes.cs (2)
137SR.Format(SR.Argument_DestinationImprecise, requiredLength), 467SR.Format(SR.Argument_DestinationImprecise, requiredLength),
System\Security\Cryptography\AesCcm.cs (1)
107throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(AesCcm)));
System\Security\Cryptography\CapiHelper.Windows.cs (2)
715throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, flags), nameof(flags)); 755throw new CryptographicException(SR.Format(SR.Cryptography_CSP_WrongKeySpec, keyType));
System\Security\Cryptography\ChaCha20Poly1305.cs (1)
112throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(ChaCha20Poly1305)));
System\Security\Cryptography\CngAlgorithmCore.cs (2)
112throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, curve.Value.CurveType.ToString())); 127throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, curve.Value.Oid.FriendlyName), e);
System\Security\Cryptography\CngKey.EC.cs (1)
64throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, algorithm));
System\Security\Cryptography\CngSymmetricAlgorithmCore.cs (1)
322SR.Format(
System\Security\Cryptography\CryptographicOperations.cs (4)
837throw new ArgumentException(SR.Format(SR.Argument_HashImprecise, hashSizeInBytes), nameof(hash)); 928throw new ArgumentException(SR.Format(SR.Argument_HashImprecise, hashSizeInBytes), nameof(hash)); 1023throw new ArgumentException(SR.Format(SR.Argument_HashImprecise, hashSizeInBytes), nameof(hash)); 1134throw new CryptographicException(SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithm.Name));
System\Security\Cryptography\CspParameters.cs (1)
43throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, nameof(value)));
System\Security\Cryptography\DSASignatureFormat.cs (1)
47SR.Format(SR.Cryptography_UnknownSignatureFormat, signatureFormat));
System\Security\Cryptography\EccKeyFormatHelper.cs (1)
531SR.Format(SR.Cryptography_CurveNotSupported, ecParameters.Curve.CurveType.ToString()));
System\Security\Cryptography\ECCurve.cs (3)
81throw new ArgumentException(SR.Format(SR.Cryptography_InvalidCurveOid, value.Value)); 195throw new CryptographicException(SR.Format(SR.Cryptography_InvalidCurveOid, Oid?.Value)); 245throw new CryptographicException(SR.Format(SR.Cryptography_CurveNotSupported, CurveType.ToString()));
System\Security\Cryptography\ECDiffieHellmanCng.Key.cs (2)
59throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_InvalidCurveOid, curve.Oid.Value)); 94throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, curve.CurveType.ToString()));
System\Security\Cryptography\ECDsaCng.Key.cs (2)
48throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_InvalidCurveOid, curve.Oid.Value)); 83throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CurveNotSupported, curve.CurveType.ToString()));
System\Security\Cryptography\HashAlgorithmName.cs (1)
195throw new CryptographicException(SR.Format(SR.Cryptography_InvalidHashAlgorithmOid, oidValue));
System\Security\Cryptography\Helpers.cs (3)
463throw new CryptographicException(SR.Format(SR.Cryptography_UnknownAlgorithmIdentifier, exportParameters.HashAlgorithm.Name)); 475throw new CryptographicException(SR.Format(SR.Cryptography_UnknownAlgorithmIdentifier, exportParameters.HashAlgorithm.Name)); 479throw new CryptographicException(SR.Format(SR.Cryptography_UnknownAlgorithmIdentifier, exportParameters.EncryptionAlgorithm));
System\Security\Cryptography\HKDF.cs (7)
57throw new ArgumentException(SR.Format(SR.Cryptography_Prk_TooSmall, hashLength), nameof(prk)); 92throw new ArgumentException(SR.Format(SR.Cryptography_Prk_TooSmall, hashLength), nameof(prk)); 98throw new ArgumentOutOfRangeException(nameof(outputLength), SR.Format(SR.Cryptography_Okm_TooLarge, maxOkmLength)); 126throw new ArgumentException(SR.Format(SR.Cryptography_Prk_TooSmall, hashLength), nameof(prk)); 131throw new ArgumentException(SR.Format(SR.Cryptography_Okm_TooLarge, maxOkmLength), nameof(output)); 159throw new ArgumentOutOfRangeException(nameof(outputLength), SR.Format(SR.Cryptography_Okm_TooLarge, maxOkmLength)); 185throw new ArgumentException(SR.Format(SR.Cryptography_Okm_TooLarge, maxOkmLength), nameof(output));
System\Security\Cryptography\HMACCommon.cs (1)
101throw new CryptographicException(SR.Format(SR.Cryptography_UnknownHashAlgorithm, _hashAlgorithmId));
System\Security\Cryptography\HMACStatic.cs (3)
27throw new ArgumentException(SR.Format(SR.Argument_HashImprecise, THMAC.HashSizeInBytes), nameof(hash)); 175throw new ArgumentException(SR.Format(SR.Argument_HashImprecise, THMAC.HashSizeInBytes), nameof(hash)); 208throw new ArgumentException(SR.Format(SR.Argument_HashImprecise, THMAC.HashSizeInBytes), nameof(hash));
System\Security\Cryptography\IncrementalHash.cs (1)
477throw new ArgumentException(SR.Format(SR.Argument_HashImprecise, ih.HashLengthInBytes), nameof(hash));
System\Security\Cryptography\PKCS1MaskGenerationMethod.cs (1)
33throw new CryptographicException(SR.Format(SR.Cryptography_UnknownHashAlgorithm, _hashNameValue));
System\Security\Cryptography\RC2Implementation.cs (2)
188throw new CryptographicException(SR.Format(SR.Cryptography_CipherModeNotSupported, CipherMode.CFB)); 199throw new CryptographicException(SR.Format(SR.Cryptography_CipherModeNotSupported, CipherMode.CFB));
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
263throw new CryptographicException(SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithm.Name));
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (1)
348throw new CryptographicException(SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithmName));
System\Security\Cryptography\RSABCrypt.cs (1)
238SR.Format(
System\Security\Cryptography\SymmetricAlgorithm.cs (3)
651throw new CryptographicException(SR.Format(SR.Cryptography_EncryptedIncorrectLength, nameof(TryEncryptEcbCore))); 938throw new CryptographicException(SR.Format(SR.Cryptography_EncryptedIncorrectLength, nameof(TryEncryptCbcCore))); 1374throw new CryptographicException(SR.Format(SR.Cryptography_EncryptedIncorrectLength, nameof(TryEncryptCfbCore)));
System\Security\Cryptography\TripleDES.cs (1)
57throw new CryptographicException(SR.Format(SR.Cryptography_InvalidKey_Weak, "TripleDES"));
System\Security\Cryptography\X509Certificates\CertificateHelpers.Windows.cs (1)
195throw new CryptographicException(SR.Format(SR.Cryptography_InvalidHandle, nameof(handle)));
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.PrivateKey.cs (2)
199throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(MLKem))); 204throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(SlhDsa)));
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (4)
530SR.Format(SR.Cryptography_CertReq_NullValueInCollection, nameof(OtherRequestAttributes))); 536SR.Format(SR.Cryptography_CertReq_MissingOidInCollection, nameof(OtherRequestAttributes))); 916SR.Format(SR.Cryptography_UnknownKeyAlgorithm, keyAlgorithm), 1073SR.Format(SR.Cryptography_CertReq_DuplicateExtension, extension.Oid.Value));
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (2)
80SR.Format(SR.Cryptography_NoPemOfLabel, PemLabels.Pkcs10CertificateRequest)); 365SR.Format(SR.Cryptography_UnknownKeyAlgorithm, algorithmIdentifier.Algorithm));
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (1)
215SR.Format(SR.Cryptography_UnknownKeyAlgorithm, keyAlgorithm),
System\Security\Cryptography\X509Certificates\ECDsaX509SignatureGenerator.cs (1)
54SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithm.Name));
System\Security\Cryptography\X509Certificates\RSAPkcs1X509SignatureGenerator.cs (1)
80SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithm.Name));
System\Security\Cryptography\X509Certificates\RSAPssX509SignatureGenerator.cs (1)
58SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithm.Name));
System\Security\Cryptography\X509Certificates\X500DistinguishedName.cs (1)
103throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, "flag"));
System\Security\Cryptography\X509Certificates\X500DistinguishedNameBuilder.cs (1)
375throw new ArgumentException(SR.Format(SR.Argument_Asn1_InvalidStringContents, stringEncodingType), paramName);
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
727throw new CryptographicException(SR.Format(SR.Cryptography_InvalidHandle, "m_safeCertContext")); // Keeping "m_safeCertContext" string for backward compat sake.
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (2)
1394_ => throw new CryptographicException(SR.Format(SR.Cryptography_UnknownKeyAlgorithm, keyAlgorithm)), 1482_ => throw new CryptographicException(SR.Format(SR.Cryptography_UnknownKeyAlgorithm, keyAlgorithm)),
System\Security\Cryptography\X509Certificates\X509CertificateLoader.netcore.cs (1)
112SR.Format(SR.Cryptography_X509_InvalidFlagCombination, persistenceFlags),
System\Security\Cryptography\X509Certificates\X509ChainPolicy.cs (4)
62throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, nameof(value))); 76throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, nameof(value))); 90throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, nameof(value))); 104throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, nameof(value)));
System\Security\Cryptography\X509Certificates\X509Store.cs (3)
40throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, nameof(storeLocation))); 52_ => throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, nameof(storeName))), 66throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, nameof(storeLocation)));
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (1)
202throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, algorithm), nameof(algorithm));