Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ RewriteEncryptedPkcs8PrivateKey() [4/4]

static AsnWriter System.Security.Cryptography.CngPkcs8.RewriteEncryptedPkcs8PrivateKey ( AsymmetricAlgorithm key,
ReadOnlySpan< char > password,
PbeParameters pbeParameters )
inlinestaticprivate

Definition at line 258 of file CngPkcs8.cs.

259 {
261 int bytesWritten = 0;
262 try
263 {
264 while (!key.TryExportEncryptedPkcs8PrivateKey(password, s_platformParameters, array, out bytesWritten))
265 {
266 int num = array.Length;
267 byte[] array2 = array;
268 array = System.Security.Cryptography.CryptoPool.Rent(checked(num * 2));
269 System.Security.Cryptography.CryptoPool.Return(array2, bytesWritten);
270 }
271 return System.Security.Cryptography.KeyFormatHelper.ReencryptPkcs8(password, array.AsMemory(0, bytesWritten), password, pbeParameters);
272 }
273 finally
274 {
276 }
277 }
static readonly PbeParameters s_platformParameters
Definition CngPkcs8.cs:26
static void Return(byte[] array, int clearSize=-1)
Definition CryptoPool.cs:12
static byte[] Rent(int minimumLength)
Definition CryptoPool.cs:7
static AsnWriter ReencryptPkcs8(ReadOnlySpan< char > inputPassword, ReadOnlyMemory< byte > current, ReadOnlySpan< char > newPassword, PbeParameters pbeParameters)

References System.array, System.key, System.Security.Cryptography.KeyFormatHelper.ReencryptPkcs8(), System.Security.Cryptography.CryptoPool.Rent(), System.Security.Cryptography.CryptoPool.Return(), and System.Security.Cryptography.CngPkcs8.s_platformParameters.