121 references to Helpers
System.Security.Cryptography (121)
src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (1)
210return Helpers.DecodeOctetStringAsMemory(encodedOctetString);
src\libraries\Common\src\System\Security\Cryptography\Asn1\PssParamsAsn.manual.cs (1)
48saltSize = Helpers.HashOidToByteLength(HashAlgorithm.Algorithm);
src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (8)
666Helpers.ThrowIfAsnInvalidLength(source); 741Helpers.ThrowIfAsnInvalidLength(source); 799Helpers.ThrowIfAsnInvalidLength(source); 856Helpers.ThrowIfAsnInvalidLength(source); 1037return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1081return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1444return Helpers.EncodeAsnWriterToPem(PemLabels.SpkiPublicKey, writer, clear: false); 1930throw Helpers.CreateAlgorithmUnknownException(writer);
src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaManaged.ECDsa.cs (1)
66Helpers.ThrowIfAsnInvalidLength(source);
src\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (1)
270return Helpers.TryCopyToDestination(derSignature, destination, out bytesWritten);
src\libraries\Common\src\System\Security\Cryptography\ECDsaOpenSsl.cs (1)
147return Helpers.TryCopyToDestination(tmpDerSignature, destination, out bytesWritten);
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (1)
208Helpers.RngFill(salt);
src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (14)
123Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.SignatureSizeInBytes); 305Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.SignatureSizeInBytes); 574Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.SignatureSizeInBytes); 716return Helpers.EncodeAsnWriterToPem(PemLabels.SpkiPublicKey, writer, clear: false); 1103return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1147return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1202Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.PublicKeySizeInBytes); 1244Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.PrivateKeySizeInBytes); 1284Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.PrivateSeedSizeInBytes); 1349Helpers.ThrowIfAsnInvalidLength(source); 1418Helpers.ThrowIfAsnInvalidLength(source); 1481Helpers.ThrowIfAsnInvalidLength(source); 1530Helpers.ThrowIfAsnInvalidLength(source); 2248throw Helpers.CreateAlgorithmUnknownException(writer);
src\libraries\Common\src\System\Security\Cryptography\MLDsaCng.cs (1)
61if (!Helpers.IsOSPlatformWindows)
src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (9)
681return Helpers.EncodeAsnWriterToPem(PemLabels.SpkiPublicKey, writer, clear: false); 1096return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1138return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1203Helpers.ThrowIfAsnInvalidLength(source); 1267Helpers.ThrowIfAsnInvalidLength(source); 1327Helpers.ThrowIfAsnInvalidLength(source); 1373Helpers.ThrowIfAsnInvalidLength(source); 1424Helpers.ThrowIfAsnInvalidLength(source); 1716throw Helpers.CreateAlgorithmUnknownException(writer);
src\libraries\Common\src\System\Security\Cryptography\MLKemCng.cs (1)
52if (!Helpers.IsOSPlatformWindows)
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (4)
77if (!Helpers.HasSymmetricEncryption) 240if (!Helpers.HasSymmetricEncryption) 571if (!Helpers.HasSymmetricEncryption) 1104if (!Helpers.IsRC2Supported)
src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (10)
333Helpers.ValidateHashLength(hash, hashAlgorithmOid); 431Helpers.ValidateHashLength(hash, hashAlgorithmOid); 561return Helpers.EncodeAsnWriterToPem(PemLabels.SpkiPublicKey, writer, clear: false); 985return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1036return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1222Helpers.ThrowIfAsnInvalidLength(source); 1285Helpers.ThrowIfAsnInvalidLength(source); 1365Helpers.ThrowIfAsnInvalidLength(source); 1414Helpers.ThrowIfAsnInvalidLength(source); 1994throw Helpers.CreateAlgorithmUnknownException(writer);
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (3)
153Helpers.DecodeOctetStringAsMemory(pfxAsn.AuthSafe.Content); 207contentData = Helpers.DecodeOctetStringAsMemory(safeContentsAsn.Content); 1238Helpers.RngFill(salt);
System\Security\Cryptography\CryptographicOperations.cs (1)
806case HashAlgorithmNames.MD5 when Helpers.HasMD5:
System\Security\Cryptography\DSA.cs (2)
516return Helpers.TryCopyToDestination(sig, destination, out bytesWritten); 534return Helpers.TryCopyToDestination(hash, destination, out bytesWritten);
System\Security\Cryptography\ECDsa.cs (1)
1106return Helpers.TryCopyToDestination(converted, destination, out bytesWritten);
System\Security\Cryptography\HKDF.cs (6)
35int hashLength = Helpers.HashLength(hashAlgorithmName); 53int hashLength = Helpers.HashLength(hashAlgorithmName); 88int hashLength = Helpers.HashLength(hashAlgorithmName); 120int hashLength = Helpers.HashLength(hashAlgorithmName); 153int hashLength = Helpers.HashLength(hashAlgorithmName); 177int hashLength = Helpers.HashLength(hashAlgorithmName);
System\Security\Cryptography\HKDFManagedImplementation.cs (2)
14Debug.Assert(Helpers.HashLength(hashAlgorithmName) == hashLength); 21Debug.Assert(Helpers.HashLength(hashAlgorithmName) == hashLength);
System\Security\Cryptography\HMACCommon.cs (2)
50ActualKey = Helpers.CloneByteArray(actualKey); 97case HashAlgorithmNames.MD5 when Helpers.HasMD5:
System\Security\Cryptography\Kmac128.cs (2)
39: this(Helpers.ArrayToSpanOrThrow(key), customizationString) 80public void AppendData(byte[] data) => AppendData(Helpers.ArrayToSpanOrThrow(data));
System\Security\Cryptography\Kmac256.cs (2)
39: this(Helpers.ArrayToSpanOrThrow(key), customizationString) 80public void AppendData(byte[] data) => AppendData(Helpers.ArrayToSpanOrThrow(data));
System\Security\Cryptography\KmacXof128.cs (2)
39: this(Helpers.ArrayToSpanOrThrow(key), customizationString) 80public void AppendData(byte[] data) => AppendData(Helpers.ArrayToSpanOrThrow(data));
System\Security\Cryptography\KmacXof256.cs (2)
39: this(Helpers.ArrayToSpanOrThrow(key), customizationString) 80public void AppendData(byte[] data) => AppendData(Helpers.ArrayToSpanOrThrow(data));
System\Security\Cryptography\MLDsaImplementation.OpenSsl.cs (2)
82Helpers.MLDsaPreHash( 95Helpers.MLDsaPreHash(
System\Security\Cryptography\MLDsaOpenSsl.OpenSsl.cs (2)
82Helpers.MLDsaPreHash( 96Helpers.MLDsaPreHash(
System\Security\Cryptography\SlhDsaImplementation.OpenSsl.cs (2)
70Helpers.SlhDsaPreHash( 83Helpers.SlhDsaPreHash(
System\Security\Cryptography\SlhDsaOpenSsl.OpenSsl.cs (2)
90Helpers.SlhDsaPreHash( 103Helpers.SlhDsaPreHash(
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (4)
510Helpers.HashAlgorithmRequired(signatureGenerator.PublicKey.Oid.Value)) 544Helpers.ValidateDer(attr.RawData); 1022Helpers.HashAlgorithmRequired(generator.PublicKey.Oid.Value)) 1034Helpers.ValidateDer(signatureAlgorithmAsn.Parameters.Value.Span);
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (2)
353case string oid when Helpers.IsSlhDsaOid(oid): 399case string oid when Helpers.IsSlhDsaOid(oid):
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (5)
144if (Helpers.HashAlgorithmRequired(issuerCertificate.GetKeyAlgorithm())) 208case string when Helpers.IsSlhDsaOid(keyAlgorithm): 342if (Helpers.HashAlgorithmRequired(generator.PublicKey.Oid.Value)) 358Helpers.ValidateDer(signatureAlgorithmAsn.Parameters.GetValueOrDefault().Span); 423Helpers.ValidateDer(encodedAkid);
System\Security\Cryptography\X509Certificates\ECDsaCertificateExtensions.cs (1)
43if (!Helpers.AreSamePublicECParameters(publicKey.ExportParameters(false), privateKey.ExportParameters(false)))
System\Security\Cryptography\X509Certificates\Pkcs10CertificationRequestInfo.cs (1)
51Helpers.ValidateDer(signatureAlgorithmAsn.Parameters.Value.Span);
System\Security\Cryptography\X509Certificates\PublicKey.cs (1)
410Helpers.IsSlhDsaOid(_oid.Value)
System\Security\Cryptography\X509Certificates\UnixExportProvider.cs (2)
53return ExportPkcs12(Helpers.Windows3desPbe, password); 66PbeParameters pbeParameters = Helpers.MapExportParametersToPbeParameters(exportParameters);
System\Security\Cryptography\X509Certificates\X509Certificate.cs (4)
369Helpers.ThrowIfInvalidPkcs12ExportParameters(exportParameters); 370Helpers.ThrowIfPasswordContainsNullCharacter(password); 411Helpers.ThrowIfInvalidPkcs12ExportParameters(exportParameters); 412Helpers.ThrowIfPasswordContainsNullCharacter(password);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (7)
772if (!Helpers.AreSamePublicECParameters(publicKey.ExportParameters(false), privateKey.ExportParameters(false))) 1005if (!Helpers.IsSlhDsaOid(GetKeyAlgorithm())) 1025Helpers.IsSlhDsaOid(GetKeyAlgorithm()) 1376Oids.Dsa when Helpers.IsDSASupported => ExtractKeyFromPem<DSA>( 1405_ when Helpers.IsSlhDsaOid(keyAlgorithm) => 1474Oids.Dsa when Helpers.IsDSASupported => 1504_ when Helpers.IsSlhDsaOid(keyAlgorithm) =>
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (4)
133Helpers.ThrowIfInvalidPkcs12ExportParameters(exportParameters); 134Helpers.ThrowIfPasswordContainsNullCharacter(password); 171Helpers.ThrowIfInvalidPkcs12ExportParameters(exportParameters); 172Helpers.ThrowIfPasswordContainsNullCharacter(password);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.OpenSsl.cs (1)
77case string when Helpers.IsSlhDsaOid(algorithm):
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Unix.cs (3)
233ReadOnlyMemory<byte> certData = Helpers.DecodeOctetStringAsMemory(certBag.CertValue); 323Helpers.DecodeOctetStringAsMemory(attr.AttrValues[0]).Span); 419Helpers.DecodeOctetStringAsMemory(attr.AttrValues[0]);