File tree Expand file tree Collapse file tree
NtApiDotNet/Win32/Security Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -239,6 +239,17 @@ public ILsaLogonCredentials ToLsaLogonCredentials(string package = Authenticatio
239239 return new SecWinNtAuthIdentityLsaLogonCredentials ( package , ToArray ( ) ) ;
240240 }
241241
242+ /// <summary>
243+ /// Decrypt the credentials if encrypted.
244+ /// </summary>
245+ /// <param name="encrypt_options">The decryption options.</param>
246+ public void Decrypt ( SecWinNtAuthIdentityEncryptionOptions encrypt_options = 0 )
247+ {
248+ if ( ! IsEncrypted )
249+ return ;
250+ SecurityNativeMethods . SspiDecryptAuthIdentityEx ( encrypt_options , _auth_id ) . CheckResult ( ) ;
251+ }
252+
242253 /// <summary>
243254 /// Convert the object to a string.
244255 /// </summary>
Original file line number Diff line number Diff line change @@ -251,22 +251,12 @@ internal static extern bool SspiIsAuthIdentityEncrypted(
251251 SafeSecWinNtAuthIdentityBuffer EncryptedAuthData
252252 ) ;
253253
254- [ DllImport ( "sspicli.dll" , CharSet = CharSet . Unicode ) ]
255- internal static extern SecStatusCode SspiDecryptAuthIdentity (
256- SafeBuffer EncryptedAuthData
257- ) ;
258-
259254 [ DllImport ( "sspicli.dll" , CharSet = CharSet . Unicode ) ]
260255 internal static extern SecStatusCode SspiDecryptAuthIdentityEx (
261256 SecWinNtAuthIdentityEncryptionOptions Options ,
262257 SafeBuffer EncryptedAuthData
263258 ) ;
264259
265- [ DllImport ( "sspicli.dll" , CharSet = CharSet . Unicode ) ]
266- internal static extern SecStatusCode SspiEncryptAuthIdentity (
267- SafeBuffer AuthData
268- ) ;
269-
270260 [ DllImport ( "sspicli.dll" , CharSet = CharSet . Unicode ) ]
271261 internal static extern SecStatusCode SspiEncryptAuthIdentityEx (
272262 SecWinNtAuthIdentityEncryptionOptions Options ,
You can’t perform that action at this time.
0 commit comments