32 result.KeyHandle = keyHandle;
40 result.KeyHandle = keyHandle;
55 if (pbeParameters ==
null)
60 if (passwordBytes.
Length == 0)
70 if (passwordBytes.
Length == 0)
101 bytesRead = bytesConsumed;
110 if (asnWriter ==
null)
150 if (asnWriter ==
null)
186 bytesRead = bytesConsumed;
197 if (bytesRead2 != bytesConsumed)
201 bytesRead = bytesConsumed;
207 if (asnWriter ==
null)
213 bytesRead = bytesConsumed;
236 int bytesWritten = 0;
243 int num =
array.Length;
244 byte[] array2 =
array;
260 int bytesWritten = 0;
265 int num =
array.Length;
266 byte[] array2 =
array;
285 if (algId.
Algorithm !=
"1.2.840.10045.2.1")
291 fixed (
byte* ptr = ret.D)
295 if (!ret.Curve.IsExplicit || ret.Q.X !=
null || ret.Q.Y !=
null)
299 byte[]
array =
new byte[ret.D.Length];
316 for (
int i = 0; i < data.
Length; i++)
static unsafe void Clear(Array array)
static string Cryptography_Der_Invalid_Encoding
static string Cryptography_Pkcs8_EncryptedReadFailed
static unsafe SafeNCryptKeyHandle ImportKeyBlob(string blobType, ReadOnlySpan< byte > keyBlob, bool encrypted=false, ReadOnlySpan< char > password=default(ReadOnlySpan< char >))
static unsafe string GetPropertyAsString(SafeNCryptHandle ncryptHandle, string propertyName, CngPropertyOptions options)
static Pkcs8Response ImportPkcs8(AsnWriter pkcs8Writer)
static bool TryExportEncryptedPkcs8PrivateKey(AsymmetricAlgorithm key, ReadOnlySpan< char > password, PbeParameters pbeParameters, Span< byte > destination, out int bytesWritten)
static bool IsPlatformScheme(PbeParameters pbeParameters)
static byte[] ExportEncryptedPkcs8PrivateKey(AsymmetricAlgorithm key, ReadOnlySpan< char > password, PbeParameters pbeParameters)
static unsafe Pkcs8Response ImportEncryptedPkcs8PrivateKey(ReadOnlySpan< byte > passwordBytes, ReadOnlySpan< byte > source, out int bytesRead)
static Pkcs8Response ImportPkcs8(ReadOnlySpan< byte > keyBlob)
static AsnWriter RewriteEncryptedPkcs8PrivateKey(AsymmetricAlgorithm key, ReadOnlySpan< char > password, PbeParameters pbeParameters)
static Pkcs8Response ImportPkcs8(ReadOnlySpan< byte > keyBlob, ReadOnlySpan< char > password)
static readonly PbeParameters s_platformParameters
static unsafe AsnWriter RewritePkcs8ECPrivateKeyWithZeroPublicKey(ReadOnlySpan< byte > source)
static AsnWriter RewriteEncryptedPkcs8PrivateKey(AsymmetricAlgorithm key, ReadOnlySpan< byte > passwordBytes, PbeParameters pbeParameters)
static byte[] ExportEncryptedPkcs8PrivateKey(AsymmetricAlgorithm key, ReadOnlySpan< byte > passwordBytes, PbeParameters pbeParameters)
static Pkcs8Response ImportPkcs8PrivateKey(ReadOnlySpan< byte > source, out int bytesRead)
static void FillRandomAsciiString(Span< char > destination)
static unsafe Pkcs8Response ImportEncryptedPkcs8PrivateKey(ReadOnlySpan< char > password, ReadOnlySpan< byte > source, out int bytesRead)
static bool TryExportEncryptedPkcs8PrivateKey(AsymmetricAlgorithm key, ReadOnlySpan< byte > passwordBytes, PbeParameters pbeParameters, Span< byte > destination, out int bytesWritten)
static void Return(byte[] array, int clearSize=-1)
static byte[] Rent(int minimumLength)
static void ValidatePbeParameters(PbeParameters pbeParameters, ReadOnlySpan< char > password, ReadOnlySpan< byte > passwordBytes)
PbeEncryptionAlgorithm EncryptionAlgorithm
static void Fill(Span< byte > data)
ReadOnlySpan< T > Slice(int start)
static ECPrivateKey Decode(ReadOnlyMemory< byte > encoded, AsnEncodingRules ruleSet)
ReadOnlyMemory< byte > PrivateKey
AttributeAsn[] Attributes
static PrivateKeyInfoAsn Decode(ReadOnlyMemory< byte > encoded, AsnEncodingRules ruleSet)
AlgorithmIdentifierAsn PrivateKeyAlgorithm
string GetAlgorithmGroup()
SafeNCryptKeyHandle KeyHandle
static HashAlgorithmName SHA1