150 references to Helpers
System.Security.Cryptography (150)
src\runtime\src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (1)
210return Helpers.DecodeOctetStringAsMemory(encodedOctetString);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptSignHash.cs (3)
35fixed (byte* pDest = &Helpers.GetNonNullPinnableReference(destination)) 61fixed (byte* pDest = &Helpers.GetNonNullPinnableReference(destination)) 89fixed (byte* pDest = &Helpers.GetNonNullPinnableReference(destination))
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptVerifySignature.cs (1)
98fixed (byte* pData = &Helpers.GetNonNullPinnableReference(data))
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.Properties.cs (1)
58Debug.Assert(Helpers.IsOSPlatformWindows);
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.SignVerify.cs (4)
18fixed (byte* pHash = &Helpers.GetNonNullPinnableReference(pbHashValue)) 19fixed (byte* pSignature = &Helpers.GetNonNullPinnableReference(pbSignature)) 30fixed (byte* pHash = &Helpers.GetNonNullPinnableReference(pbHashValue)) 31fixed (byte* pSignature = &Helpers.GetNonNullPinnableReference(pbSignature))
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AeadCommon.Windows.cs (10)
22fixed (byte* plaintextBytes = &Helpers.GetNonNullPinnableReference(plaintext)) 23fixed (byte* nonceBytes = &Helpers.GetNonNullPinnableReference(nonce)) 24fixed (byte* ciphertextBytes = &Helpers.GetNonNullPinnableReference(ciphertext)) 25fixed (byte* tagBytes = &Helpers.GetNonNullPinnableReference(tag)) 26fixed (byte* associatedDataBytes = &Helpers.GetNonNullPinnableReference(associatedData)) 67fixed (byte* plaintextBytes = &Helpers.GetNonNullPinnableReference(plaintext)) 68fixed (byte* nonceBytes = &Helpers.GetNonNullPinnableReference(nonce)) 69fixed (byte* ciphertextBytes = &Helpers.GetNonNullPinnableReference(ciphertext)) 70fixed (byte* tagBytes = &Helpers.GetNonNullPinnableReference(tag)) 71fixed (byte* associatedDataBytes = &Helpers.GetNonNullPinnableReference(associatedData))
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\PssParamsAsn.manual.cs (1)
48saltSize = Helpers.HashOidToByteLength(HashAlgorithm.Algorithm);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (8)
666Helpers.ThrowIfAsnInvalidLength(source); 741Helpers.ThrowIfAsnInvalidLength(source); 799Helpers.ThrowIfAsnInvalidLength(source); 856Helpers.ThrowIfAsnInvalidLength(source); 1031return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1075return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1438return Helpers.EncodeAsnWriterToPem(PemLabels.SpkiPublicKey, writer, clear: false); 1920throw Helpers.CreateAlgorithmUnknownException(in identifier);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaImplementation.Windows.cs (5)
18if (!Helpers.IsOSPlatformWindows) 28if (!Helpers.IsOSPlatformWindows) 38if (!Helpers.IsOSPlatformWindows) 48if (!Helpers.IsOSPlatformWindows) 58if (!Helpers.IsOSPlatformWindows)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaManaged.ECDsa.cs (1)
66Helpers.ThrowIfAsnInvalidLength(source);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (1)
239Helpers.RngFill(salt);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (14)
122Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.SignatureSizeInBytes); 305Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.SignatureSizeInBytes); 580Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.SignatureSizeInBytes); 726return Helpers.EncodeAsnWriterToPem(PemLabels.SpkiPublicKey, writer, clear: false); 1113return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1157return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1212Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.PublicKeySizeInBytes); 1254Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.PrivateKeySizeInBytes); 1294Helpers.ThrowIfDestinationWrongLength(destination, Algorithm.PrivateSeedSizeInBytes); 1359Helpers.ThrowIfAsnInvalidLength(source); 1422Helpers.ThrowIfAsnInvalidLength(source); 1485Helpers.ThrowIfAsnInvalidLength(source); 1534Helpers.ThrowIfAsnInvalidLength(source); 2253throw Helpers.CreateAlgorithmUnknownException(in identifier);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaCng.cs (1)
60if (!Helpers.IsOSPlatformWindows)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.Windows.cs (1)
257if (!Helpers.IsOSPlatformWindows)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (9)
677return Helpers.EncodeAsnWriterToPem(PemLabels.SpkiPublicKey, writer, clear: false); 1081return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1122return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1185Helpers.ThrowIfAsnInvalidLength(source); 1247Helpers.ThrowIfAsnInvalidLength(source); 1305Helpers.ThrowIfAsnInvalidLength(source); 1350Helpers.ThrowIfAsnInvalidLength(source); 1400Helpers.ThrowIfAsnInvalidLength(source); 1684throw Helpers.CreateAlgorithmUnknownException(in identifier);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemCng.cs (1)
52if (!Helpers.IsOSPlatformWindows)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.Windows.cs (1)
141if (!Helpers.IsOSPlatformWindows)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (4)
105if (!Helpers.HasSymmetricEncryption) 268if (!Helpers.HasSymmetricEncryption) 602if (!Helpers.HasSymmetricEncryption) 1146if (!Helpers.IsRC2Supported)
src\runtime\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); 1364Helpers.ThrowIfAsnInvalidLength(source); 1413Helpers.ThrowIfAsnInvalidLength(source); 1992throw Helpers.CreateAlgorithmUnknownException(in identifier);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (3)
153Helpers.DecodeOctetStringAsMemory(pfxAsn.AuthSafe.Content); 207contentData = Helpers.DecodeOctetStringAsMemory(safeContentsAsn.Content); 1237Helpers.RngFill(salt);
System\Security\Cryptography\CryptoConfig.cs (1)
193if (Helpers.IsDSASupported)
System\Security\Cryptography\CryptographicOperations.cs (1)
1131case 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\HashProviderDispenser.Windows.cs (1)
277fixed (byte* pDest = &Helpers.GetNonNullPinnableReference(destination))
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\HKDF.Windows.cs (3)
148fixed (byte* pSecret = &Helpers.GetNonNullPinnableReference(secret)) 168fixed (byte* pSalt = &Helpers.GetNonNullPinnableReference(salt)) 196fixed (byte* pInfoBlob = &Helpers.GetNonNullPinnableReference(infoBlob))
System\Security\Cryptography\HKDFManagedImplementation.cs (1)
20Debug.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)
46: this(Helpers.ArrayToSpanOrThrow(key), customizationString) 87public void AppendData(byte[] data) => AppendData(Helpers.ArrayToSpanOrThrow(data));
System\Security\Cryptography\Kmac256.cs (2)
46: this(Helpers.ArrayToSpanOrThrow(key), customizationString) 87public void AppendData(byte[] data) => AppendData(Helpers.ArrayToSpanOrThrow(data));
System\Security\Cryptography\KmacXof128.cs (2)
46: this(Helpers.ArrayToSpanOrThrow(key), customizationString) 87public void AppendData(byte[] data) => AppendData(Helpers.ArrayToSpanOrThrow(data));
System\Security\Cryptography\KmacXof256.cs (2)
46: this(Helpers.ArrayToSpanOrThrow(key), customizationString) 87public void AppendData(byte[] data) => AppendData(Helpers.ArrayToSpanOrThrow(data));
System\Security\Cryptography\LiteHash.Windows.cs (5)
133fixed (byte* pDestination = &Helpers.GetNonNullPinnableReference(destination)) 146fixed (byte* pDestination = &Helpers.GetNonNullPinnableReference(destination)) 247fixed (byte* pDestination = &Helpers.GetNonNullPinnableReference(destination)) 268fixed (byte* pDestination = &Helpers.GetNonNullPinnableReference(destination)) 287fixed (byte* pDestination = &Helpers.GetNonNullPinnableReference(destination))
System\Security\Cryptography\X25519DiffieHellman.cs (7)
727return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 764return Helpers.EncodeAsnWriterToPem(PemLabels.EncryptedPkcs8PrivateKey, writer, clear: false); 1000Helpers.ThrowIfAsnInvalidLength(source); 1074Helpers.ThrowIfAsnInvalidLength(source); 1132Helpers.ThrowIfAsnInvalidLength(source); 1177Helpers.ThrowIfAsnInvalidLength(source); 1227Helpers.ThrowIfAsnInvalidLength(source);
System\Security\Cryptography\X25519DiffieHellmanCng.Windows.cs (1)
21Debug.Assert(Helpers.IsOSPlatformWindows);
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)
360case string oid when Helpers.IsSlhDsaOid(oid): 406case 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)
406Helpers.IsSlhDsaOid(_oid.Value)
System\Security\Cryptography\X509Certificates\StorePal.Windows.Export.cs (2)
129reEncodeParameters = Helpers.WindowsAesPbe; 136reEncodeParameters = Helpers.Windows3desPbe;
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))) 999if (!Helpers.IsSlhDsaOid(GetKeyAlgorithm())) 1019Helpers.IsSlhDsaOid(GetKeyAlgorithm()) 1370Oids.Dsa when Helpers.IsDSASupported => ExtractKeyFromPem<DSA>( 1388_ when Helpers.IsSlhDsaOid(keyAlgorithm) => 1457Oids.Dsa when Helpers.IsDSASupported => 1476_ when Helpers.IsSlhDsaOid(keyAlgorithm) =>
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (4)
133Helpers.ThrowIfInvalidPkcs12ExportParameters(exportParameters); 134Helpers.ThrowIfPasswordContainsNullCharacter(password); 171Helpers.ThrowIfInvalidPkcs12ExportParameters(exportParameters); 172Helpers.ThrowIfPasswordContainsNullCharacter(password);