| Author | 
         | 
         
      
        
         
         MikhailBelov Newbie 
          
 
  Joined: 17 March 2024 Location: United States
 Online Status: Offline Posts: 1
          | 
        
         
          
           | Posted: 17 March 2024 at 2:33pm | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Hello
 Based on:
 https://afterlogic.com/mailbee-net/docs/MailBee.Security.CertificateStoreConstructor5.html
 
 Dim store As New CertificateStore("MY", CertStoreType.System, Nothing)
 This will open StoreLocation.CurrentUser, can you please specify how to open StoreLocation.LocalMachine?
 
 
 
 MailBee.Security.CertificateCollection does not have Import and Export methods like X509Certificate2Collection.
 MailBee.Security.CertificateCollection.FromX509Certificate2Collection does not exist too.
 Addition of those missing methods will not be a challenge.
 
 
 
 Due to the lack of Export method, I tried the Store class but there's a problem in MailBee.Security.CertificateStore, based on this sample:
 https://afterlogic.com/mailbee-net/docs/#MailBee.Security.html
 ...
 Dim store As CertificateStore = New CertificateStore(personalX509Store)
 store.SaveToFile(filename, CertStoreFileType.P7b, Nothing)
 
 An unhandled exception of type 'System.AccessViolationException' occurred in MailBee.NET.dll
 
 Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
 
 Calling store.GetAllCertificates also throws the same exception.
 
 .Net Framework 4.8 Windows Forms app.
 Very best
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Igor AfterLogic Support 
          
 
  Joined: 24 June 2008 Location: United States
 Online Status: Offline Posts: 6168
          | 
        
         
          
           | Posted: 18 March 2024 at 3:00am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
We've just responded to HelpDesk ticket you've created on this. Thanks.
 
 --
 Regards,
 Igor, Afterlogic Support
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   |