![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| | |||||||
| | Vista - Powershell + certificate = encrypted/signed email? |
| |
| 06-07-2008 | #1 |
| | Powershell + certificate = encrypted/signed email? I have certs to sign and/or encrypt email via outlook. Using openssl, I can create a command line to sign/encrypt an email using said cert and send it. Can I do the same with PowerShell? It seems there is reference to certs here: PS C:\Documents and Settings\Blake\Desktop\PowerShell\scripts> $SmtpClient = new-object system.net.mail.smtpClient PS C:\Documents and Settings\Blake\Desktop\PowerShell\scripts> $SmtpClient Host : Port : 25 UseDefaultCredentials : False Credentials : Timeout : 100000 ServicePoint : DeliveryMethod : Network PickupDirectoryLocation : EnableSsl : False ClientCertificates : {} |
| My System Specs |
| 06-08-2008 | #2 |
| | Re: Powershell + certificate = encrypted/signed email? Blake wrote: Quote: > I have certs to sign and/or encrypt email via outlook. Using openssl, I can > create a command line to sign/encrypt an email using said cert and send it. > > Can I do the same with PowerShell? It seems there is reference to certs > here: Quote: > PS C:\Documents and Settings\Blake\Desktop\PowerShell\scripts> $SmtpClient = > new-object system.net.mail.smtpClient > PS C:\Documents and Settings\Blake\Desktop\PowerShell\scripts> $SmtpClient > > > Host : > Port : 25 > UseDefaultCredentials : False > Credentials : > Timeout : 100000 > ServicePoint : > DeliveryMethod : Network > PickupDirectoryLocation : > EnableSsl : False > ClientCertificates : {} http://msdn.microsoft.com/en-us/libr...tificates.aspx Looks like you have to tell the .NET Framework some other way what cert(s) are available. Not a fix, but it might help you to start looking in the right direction... I'll try and look at it again also, time permitting... Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
| My System Specs |
| 06-10-2008 | #3 |
| | Re: Powershell + certificate = encrypted/signed email? I appreciate the response I could use PS in conjunction with OpenSSL, but was hoping to avoid multiple steps. If you come up with anything feel free to reply. Thanks Blake "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote in message news:OVukl3cyIHA.5716@xxxxxx Quote: > Blake wrote: Quote: >> I have certs to sign and/or encrypt email via outlook. Using openssl, I >> can create a command line to sign/encrypt an email using said cert and >> send it. >> >> Can I do the same with PowerShell? It seems there is reference to certs >> here: Quote: >> PS C:\Documents and Settings\Blake\Desktop\PowerShell\scripts> >> $SmtpClient = new-object system.net.mail.smtpClient >> PS C:\Documents and Settings\Blake\Desktop\PowerShell\scripts> >> $SmtpClient >> >> >> Host : >> Port : 25 >> UseDefaultCredentials : False >> Credentials : >> Timeout : 100000 >> ServicePoint : >> DeliveryMethod : Network >> PickupDirectoryLocation : >> EnableSsl : False >> ClientCertificates : {} > That property is read-only: > http://msdn.microsoft.com/en-us/libr...tificates.aspx > > Looks like you have to tell the .NET Framework some other way what cert(s) > are available. > > Not a fix, but it might help you to start looking in the right > direction... > > I'll try and look at it again also, time permitting... > > Marco > > -- > Microsoft MVP - Windows PowerShell > http://www.microsoft.com/mvp > > PowerGadgets MVP > http://www.powergadgets.com/mvp > > Blog: > http://marcoshaw.blogspot.com |
| My System Specs |
| 06-11-2008 | #4 |
| | Re: Powershell + certificate = encrypted/signed email? Blake wrote: Quote: > I appreciate the response > > I could use PS in conjunction with OpenSSL, but was hoping to avoid multiple > steps. anyone indicating how this could be done in C# either. Marco |
| My System Specs |
| 06-12-2008 | #5 |
| | Re: Powershell + certificate = encrypted/signed email? Blake wrote: Quote: > I appreciate the response > > I could use PS in conjunction with OpenSSL, but was hoping to avoid multiple > steps. > > If you come up with anything feel free to reply. PS > cd cert:\currentuser\my PS > gci . PS > $cert=gci .| where{$_.subject -like "match_something_for_the_cert_you_want_if_you_have_several*"} <--Get a cert object PS > $smtpclient.clientcertificates.Add($cert) <--Should return a "0". If you check $smtpclient after, you should have soemthing show up. Marco |
| My System Specs |
![]() |
| Thread Tools | |
| |
| Similar Threads for: Powershell + certificate = encrypted/signed email? | ||||
| Thread | Forum | |||
| self-signed certificate issue | PowerShell | |||
| certificate expiring (self signed) | .NET General | |||
| Encrypted File System (EFS) Certificate Backup | Tutorials | |||
| Encrypted File System (EFS) Certificate Restore | Tutorials | |||
| can not send signed/encrypted emails | Vista mail | |||