public static SafeKeyHandleImpl DuplicateKey(IntPtr sourceKeyHandle) { var keyHandle = SafeKeyHandleImpl.InvalidHandle; if (!CryptoApi.CryptDuplicateKey(sourceKeyHandle, null, 0, ref keyHandle)) { throw CreateWin32Error(); } return(keyHandle); }