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

◆ GuessKeySpec()

static int Internal.Cryptography.Pal.CertificatePal.GuessKeySpec ( CngProvider provider,
string keyName,
bool machineKey,
CngAlgorithmGroup algorithmGroup )
inlinestaticprivate

Definition at line 917 of file CertificatePal.cs.

918 {
920 {
921 return 0;
922 }
923 try
924 {
925 CngKeyOpenOptions openOptions = (machineKey ? CngKeyOpenOptions.MachineKey : CngKeyOpenOptions.None);
927 {
928 return 0;
929 }
930 }
932 {
934 {
935 ProviderName = provider.Provider,
936 KeyContainerName = keyName,
937 Flags = CspProviderFlags.UseExistingKey,
938 KeyNumber = 2
939 };
940 if (machineKey)
941 {
942 cspParameters.Flags |= CspProviderFlags.UseMachineKeyStore;
943 }
945 {
946 return keySpec;
947 }
948 throw;
949 }
950 }
static bool TryGuessKeySpec(CspParameters cspParameters, CngAlgorithmGroup algorithmGroup, out int keySpec)
static CngKey Open(string keyName)
Definition CngKey.cs:799
static CngProvider MicrosoftSmartCardKeyStorageProvider
static CngProvider MicrosoftSoftwareKeyStorageProvider

References System.Security.Cryptography.CngProvider.MicrosoftSmartCardKeyStorageProvider, System.Security.Cryptography.CngProvider.MicrosoftSoftwareKeyStorageProvider, System.Security.Cryptography.CngKey.Open(), and Internal.Cryptography.Pal.CertificatePal.TryGuessKeySpec().

Referenced by Internal.Cryptography.Pal.CertificatePal.CopyWithPersistedCngKey().