src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (17)
1034AsnWriter writer = WriteEncryptedPkcs8PrivateKeyToAsnWriter(password, pbeParameters);
1078AsnWriter writer = WriteEncryptedPkcs8PrivateKeyToAsnWriter(passwordBytes, pbeParameters);
1130AsnWriter writer = WriteEncryptedPkcs8PrivateKeyToAsnWriter(passwordBytes, pbeParameters);
1175AsnWriter writer = WriteEncryptedPkcs8PrivateKeyToAsnWriter(password, pbeParameters);
1248AsnWriter writer = WriteEncryptedPkcs8PrivateKeyToAsnWriter(password, pbeParameters);
1308AsnWriter writer = WriteEncryptedPkcs8PrivateKeyToAsnWriter(passwordBytes, pbeParameters);
1441AsnWriter writer = WriteSubjectPublicKeyToAsnWriter();
1491AsnWriter writer = WriteSubjectPublicKeyToAsnWriter();
1804private AsnWriter WriteEncryptedPkcs8PrivateKeyToAsnWriter(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters)
1806AsnWriter? tmp = null;
1819private AsnWriter WriteEncryptedPkcs8PrivateKeyToAsnWriter(ReadOnlySpan<char> password, PbeParameters pbeParameters)
1821AsnWriter? tmp = null;
1834private AsnWriter WritePkcs8ToAsnWriter()
1838AsnWriter writer = new(AsnEncodingRules.BER, initialCapacity: pkcs8.Length);
1854private AsnWriter WriteSubjectPublicKeyToAsnWriter()
1872AsnWriter writer = new AsnWriter(AsnEncodingRules.DER, capacity);
1928AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (18)
662AsnWriter writer = ExportSubjectPublicKeyInfoCore();
691AsnWriter writer = ExportSubjectPublicKeyInfoCore();
713AsnWriter writer = ExportSubjectPublicKeyInfoCore();
861AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(password, pbeParameters);
908AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(passwordBytes, pbeParameters);
977AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(password, pbeParameters);
1037AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(passwordBytes, pbeParameters);
1100AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(password, pbeParameters);
1144AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(passwordBytes, pbeParameters);
2040private AsnWriter ExportSubjectPublicKeyInfoCore()
2054AsnWriter writer = new AsnWriter(AsnEncodingRules.DER, capacity);
2076private AsnWriter ExportEncryptedPkcs8PrivateKeyCore(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters)
2078AsnWriter tmp = ExportPkcs8PrivateKeyCallback(static pkcs8 =>
2080AsnWriter writer = new(AsnEncodingRules.BER, initialCapacity: pkcs8.Length);
2105private AsnWriter ExportEncryptedPkcs8PrivateKeyCore(ReadOnlySpan<char> password, PbeParameters pbeParameters)
2107AsnWriter tmp = ExportPkcs8PrivateKeyCallback(static pkcs8 =>
2109AsnWriter writer = new(AsnEncodingRules.BER, initialCapacity: pkcs8.Length);
2246AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (18)
509AsnWriter writer = ExportSubjectPublicKeyInfoCore();
559AsnWriter writer = ExportSubjectPublicKeyInfoCore();
666AsnWriter writer = new AsnWriter(AsnEncodingRules.DER, capacity);
741AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(password, pbeParameters);
788AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(passwordBytes, pbeParameters);
857AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(password, pbeParameters);
917AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(passwordBytes, pbeParameters);
980AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(password, pbeParameters);
1031AsnWriter writer = ExportEncryptedPkcs8PrivateKeyCore(passwordBytes, pbeParameters);
1866private AsnWriter ExportSubjectPublicKeyInfoCore()
1879AsnWriter writer = new AsnWriter(AsnEncodingRules.DER, capacity);
1895private AsnWriter ExportEncryptedPkcs8PrivateKeyCore(ReadOnlySpan<char> password, PbeParameters pbeParameters)
1897AsnWriter tmp = ExportPkcs8PrivateKeyCallback(static pkcs8 =>
1899AsnWriter writer = new(AsnEncodingRules.BER, initialCapacity: pkcs8.Length);
1923private AsnWriter ExportEncryptedPkcs8PrivateKeyCore(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters)
1925AsnWriter tmp = ExportPkcs8PrivateKeyCallback(static pkcs8 =>
1927AsnWriter writer = new(AsnEncodingRules.BER, initialCapacity: pkcs8.Length);
1992AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
System\Security\Cryptography\EccKeyFormatHelper.cs (21)
227AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
433internal static AsnWriter WriteSubjectPublicKeyInfo(ECParameters ecParameters)
440AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
455private static AsnWriter WriteAlgorithmIdentifier(in ECParameters ecParameters)
457AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
462private static void WriteAlgorithmIdentifier(in ECParameters ecParameters, AsnWriter writer)
472internal static AsnWriter WritePkcs8PrivateKey(ECParameters ecParameters, AttributeAsn[]? attributes = null)
482AsnWriter ecPrivateKey = WriteEcPrivateKey(ecParameters, includeDomainParameters: false);
483AsnWriter algorithmIdentifier = WriteAlgorithmIdentifier(ecParameters);
484AsnWriter? attributeWriter = WritePrivateKeyInfoAttributes(attributes);
490private static AsnWriter? WritePrivateKeyInfoAttributes(AttributeAsn[]? attributes)
495AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);
508private static void WriteEcParameters(ECParameters ecParameters, AsnWriter writer)
535private static void WriteSpecifiedECDomain(ECParameters ecParameters, AsnWriter writer)
718private static void WriteCurve(in ECCurve curve, AsnWriter writer)
732private static void WriteFieldElement(byte[] fieldElement, AsnWriter writer)
744private static void WriteUncompressedBasePoint(in ECParameters ecParameters, AsnWriter writer)
772private static void WriteUncompressedPublicKey(in ECParameters ecParameters, AsnWriter writer)
777internal static AsnWriter WriteECPrivateKey(in ECParameters ecParameters)
782private static AsnWriter WriteEcPrivateKey(in ECParameters ecParameters, bool includeDomainParameters)
784AsnWriter writer = new AsnWriter(AsnEncodingRules.DER);