Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Security.Cryptography.RSAImplementation.RSACng Class Referencesealed

Public Member Functions

 RSACng ()
 
 RSACng (int keySize)
 
override byte[] Encrypt (byte[] data, RSAEncryptionPadding padding)
 
override byte[] Decrypt (byte[] data, RSAEncryptionPadding padding)
 
override bool TryEncrypt (ReadOnlySpan< byte > data, Span< byte > destination, RSAEncryptionPadding padding, out int bytesWritten)
 
override bool TryDecrypt (ReadOnlySpan< byte > data, Span< byte > destination, RSAEncryptionPadding padding, out int bytesWritten)
 
unsafe override void ImportParameters (RSAParameters parameters)
 
override void ImportPkcs8PrivateKey (ReadOnlySpan< byte > source, out int bytesRead)
 
override void ImportEncryptedPkcs8PrivateKey (ReadOnlySpan< byte > passwordBytes, ReadOnlySpan< byte > source, out int bytesRead)
 
override void ImportEncryptedPkcs8PrivateKey (ReadOnlySpan< char > password, ReadOnlySpan< byte > source, out int bytesRead)
 
override byte[] ExportEncryptedPkcs8PrivateKey (ReadOnlySpan< byte > passwordBytes, PbeParameters pbeParameters)
 
override byte[] ExportEncryptedPkcs8PrivateKey (ReadOnlySpan< char > password, PbeParameters pbeParameters)
 
override bool TryExportEncryptedPkcs8PrivateKey (ReadOnlySpan< byte > passwordBytes, PbeParameters pbeParameters, Span< byte > destination, out int bytesWritten)
 
override bool TryExportEncryptedPkcs8PrivateKey (ReadOnlySpan< char > password, PbeParameters pbeParameters, Span< byte > destination, out int bytesWritten)
 
override RSAParameters ExportParameters (bool includePrivateParameters)
 
unsafe override byte[] SignHash (byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
 
unsafe override bool TrySignHash (ReadOnlySpan< byte > hash, Span< byte > destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten)
 
override bool VerifyHash (byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
 
unsafe override bool VerifyHash (ReadOnlySpan< byte > hash, ReadOnlySpan< byte > signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
 
virtual byte[] DecryptValue (byte[] rgb)
 
virtual byte[] EncryptValue (byte[] rgb)
 
byte[] SignData (byte[] data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
 
virtual byte[] SignData (byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
 
virtual byte[] SignData (Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
 
virtual bool TrySignData (ReadOnlySpan< byte > data, Span< byte > destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten)
 
bool VerifyData (byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
 
virtual bool VerifyData (byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
 
bool VerifyData (Stream data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
 
virtual bool VerifyData (ReadOnlySpan< byte > data, ReadOnlySpan< byte > signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
 
virtual byte[] ExportRSAPrivateKey ()
 
virtual bool TryExportRSAPrivateKey (Span< byte > destination, out int bytesWritten)
 
virtual byte[] ExportRSAPublicKey ()
 
virtual bool TryExportRSAPublicKey (Span< byte > destination, out int bytesWritten)
 
unsafe override bool TryExportSubjectPublicKeyInfo (Span< byte > destination, out int bytesWritten)
 
override bool TryExportPkcs8PrivateKey (Span< byte > destination, out int bytesWritten)
 
unsafe override void ImportSubjectPublicKeyInfo (ReadOnlySpan< byte > source, out int bytesRead)
 
virtual unsafe void ImportRSAPublicKey (ReadOnlySpan< byte > source, out int bytesRead)
 
virtual unsafe void ImportRSAPrivateKey (ReadOnlySpan< byte > source, out int bytesRead)
 
override void ImportFromPem (ReadOnlySpan< char > input)
 
override void ImportFromEncryptedPem (ReadOnlySpan< char > input, ReadOnlySpan< char > password)
 
override void ImportFromEncryptedPem (ReadOnlySpan< char > input, ReadOnlySpan< byte > passwordBytes)
 
override void FromXmlString (string xmlString)
 
override string ToXmlString (bool includePrivateParameters)
 
void Clear ()
 
void Dispose ()
 
virtual byte[] ExportPkcs8PrivateKey ()
 
virtual byte[] ExportSubjectPublicKeyInfo ()
 

Static Public Member Functions

static new? RSA Create (string algName)
 
static RSA Create (int keySizeInBits)
 
static RSA Create (RSAParameters parameters)
 
static new RSA Create ()
 

Protected Member Functions

override void Dispose (bool disposing)
 
override byte[] HashData (byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
 
override bool TryHashData (ReadOnlySpan< byte > data, Span< byte > destination, HashAlgorithmName hashAlgorithm, out int bytesWritten)
 
override byte[] HashData (Stream data, HashAlgorithmName hashAlgorithm)
 

Protected Attributes

int KeySizeValue
 
KeySizes[] LegalKeySizesValue
 

Properties

override KeySizes[] LegalKeySizes [get]
 
override? string KeyExchangeAlgorithm [get]
 
override string SignatureAlgorithm [get]
 
virtual int KeySize [get, set]
 

Private Member Functions

void ThrowIfDisposed ()
 
SafeNCryptKeyHandle GetDuplicatedKeyHandle ()
 
byte[] ExportKeyBlob (bool includePrivateParameters)
 
byte[] ExportEncryptedPkcs8 (ReadOnlySpan< char > pkcs8Password, int kdfCount)
 
bool TryExportEncryptedPkcs8 (ReadOnlySpan< char > pkcs8Password, int kdfCount, Span< byte > destination, out int bytesWritten)
 
void ImportKeyBlob (byte[] rsaBlob, bool includePrivate)
 
void AcceptImport (CngPkcs8.Pkcs8Response response)
 
void SetKeyHandle (SafeNCryptKeyHandle keyHandle)
 
void ForceSetKeySize (int newKeySize)
 
unsafe byte[] EncryptOrDecrypt (byte[] data, RSAEncryptionPadding padding, bool encrypt)
 
unsafe bool TryEncryptOrDecrypt (ReadOnlySpan< byte > data, Span< byte > destination, RSAEncryptionPadding padding, bool encrypt, out int bytesWritten)
 
unsafe byte[] EncryptOrDecrypt (SafeNCryptKeyHandle key, ReadOnlySpan< byte > input, global::Interop.NCrypt.AsymmetricPaddingMode paddingMode, void *paddingInfo, bool encrypt)
 
unsafe bool TryEncryptOrDecrypt (SafeNCryptKeyHandle key, ReadOnlySpan< byte > input, Span< byte > output, global::Interop.NCrypt.AsymmetricPaddingMode paddingMode, void *paddingInfo, bool encrypt, out int bytesWritten)
 
void ProcessPkcs8Response (CngPkcs8.Pkcs8Response response)
 
unsafe AsnWriter WritePkcs8PrivateKey ()
 
AsnWriter WritePkcs1PublicKey ()
 
unsafe AsnWriter WritePkcs1PrivateKey ()
 
delegate bool TryExportPbe< T > (ReadOnlySpan< T > password, PbeParameters pbeParameters, Span< byte > destination, out int bytesWritten)
 
delegate bool TryExport (Span< byte > destination, out int bytesWritten)
 

Static Private Member Functions

static unsafe global::Interop.NCrypt.ErrorCode EncryptOrDecrypt (SafeNCryptKeyHandle key, ReadOnlySpan< byte > input, Span< byte > output, global::Interop.NCrypt.AsymmetricPaddingMode paddingMode, void *paddingInfo, bool encrypt, out int bytesNeeded)
 
static unsafe void ExportParameters (ref RSAParameters rsaParams, byte[] rsaBlob, bool includePrivateParameters)
 
static void CheckMagicValueOfKey (global::Interop.BCrypt.KeyBlobMagicNumber magic, bool includePrivateParameters)
 
static int GetHashSizeInBytes (HashAlgorithmName hashAlgorithm)
 
static Exception DerivedClassMustOverride ()
 
static void ClearPrivateParameters (in RSAParameters rsaParameters)
 
static Exception HashAlgorithmNameNullOrEmpty ()
 
static byte[] ReadRequiredElement (ref XmlKeyHelper.ParseState state, string name, int sizeHint=-1)
 
static unsafe byte[] ExportArray< T > (ReadOnlySpan< T > password, PbeParameters pbeParameters, TryExportPbe< T > exporter)
 
static unsafe byte[] ExportArray (TryExport exporter)
 

Private Attributes

SafeNCryptKeyHandle _keyHandle
 
int _lastKeySize
 
bool _disposed
 

Static Private Attributes

static readonly ConcurrentDictionary< HashAlgorithmName, int > s_hashSizes
 

Detailed Description

Definition at line 12 of file RSAImplementation.cs.


The documentation for this class was generated from the following file: