Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. Export-Certificate -Cert $cert -FilePath ".DevConfig.cer"
  2.  
  3. $mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText
  4.  
  5. Export-PfxCertificate -Cert $cert -FilePath ".DevConfig.pfx" -Password $mypwd
  6.  
  7. $cert
  8.  
  9. Import-Certificate -Filepath ".DevConfig.cer" -CertStoreLocation cert:LocalMachineMy
  10.  
  11. $mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText
  12.  
  13. Import-PfxCertificate -FilePath ".DevConfig.pfx" -CertStoreLocation Cert:LocalMachineMy -Password $mypwd
  14.  
  15. Install-Package WebConfigEncrypter -Version 1.1.0
  16.  
  17. <configProtectedData>
  18. <providers>
  19. <add name="Pkcs12Provider" thumbprint="91cb0b7c611e54f6bfd43c4d8d178b542bc6557e" type="WebConfigEncrypter.Pkcs12ProtectedConfigurationProvider, WebConfigEncrypter" storeLocation="LocalMachine"/>
  20. </providers>
  21. </configProtectedData>
  22.  
  23. aspnet_regiis -pef "connectionStrings" "." -prov "Pkcs12Provider"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement