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

◆ TryExportEncryptedPkcs8PrivateKey() [2/4]

static bool System.Security.Cryptography.CngPkcs8.TryExportEncryptedPkcs8PrivateKey ( AsymmetricAlgorithm key,
ReadOnlySpan< byte > passwordBytes,
PbeParameters pbeParameters,
Span< byte > destination,
out int bytesWritten )
inlinestaticpackage

Definition at line 69 of file CngPkcs8.cs.

70 {
71 if (passwordBytes.Length == 0)
72 {
73 return key.TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char>.Empty, pbeParameters, destination, out bytesWritten);
74 }
75 AsnWriter asnWriter = RewriteEncryptedPkcs8PrivateKey(key, passwordBytes, pbeParameters);
76 return asnWriter.TryEncode(destination, out bytesWritten);
77 }
bool TryEncode(Span< byte > destination, out int bytesWritten)
Definition AsnWriter.cs:173
static AsnWriter RewriteEncryptedPkcs8PrivateKey(AsymmetricAlgorithm key, ReadOnlySpan< byte > passwordBytes, PbeParameters pbeParameters)
Definition CngPkcs8.cs:233

References System.destination, System.key, System.ReadOnlySpan< T >.Length, System.Security.Cryptography.CngPkcs8.RewriteEncryptedPkcs8PrivateKey(), and System.Formats.Asn1.AsnWriter.TryEncode().