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

◆ WritePkcs8PrivateKey()

static AsnWriter System.Security.Cryptography.RSAKeyFormatHelper.WritePkcs8PrivateKey ( ReadOnlySpan< byte > pkcs1PrivateKey,
AsnWriter copyFrom = null )
inlinestaticpackage

Definition at line 66 of file RSAKeyFormatHelper.cs.

67 {
68 AsnWriter asnWriter = new AsnWriter(AsnEncodingRules.BER);
69 using (asnWriter.PushSequence())
70 {
71 asnWriter.WriteInteger(0L);
72 WriteAlgorithmIdentifier(asnWriter);
73 if (copyFrom != null)
74 {
75 using (asnWriter.PushOctetString())
76 {
77 copyFrom.CopyTo(asnWriter);
78 }
79 }
80 else
81 {
82 asnWriter.WriteOctetString(pkcs1PrivateKey);
83 }
84 }
85 return asnWriter;
86 }
void WriteOctetString(ReadOnlySpan< byte > value, Asn1Tag? tag=null)
Definition AsnWriter.cs:904
Scope PushSequence(Asn1Tag? tag=null)
void CopyTo(AsnWriter destination)
Definition AsnWriter.cs:328
Scope PushOctetString(Asn1Tag? tag=null)
Definition AsnWriter.cs:892
void WriteInteger(long value, Asn1Tag? tag=null)
Definition AsnWriter.cs:665
static void WriteAlgorithmIdentifier(AsnWriter writer)

References System.L, System.Formats.Asn1.AsnWriter.PushOctetString(), System.Formats.Asn1.AsnWriter.PushSequence(), System.Security.Cryptography.RSAKeyFormatHelper.WriteAlgorithmIdentifier(), System.Formats.Asn1.AsnWriter.WriteInteger(), and System.Formats.Asn1.AsnWriter.WriteOctetString().

Referenced by System.Security.Cryptography.RSA.WritePkcs8PrivateKey().