Self-signed certificate with an expiry date of more than one year

If you want to create a self-signed certificate using windows power shell. Follow the below instruction

To create the certificate:

1. Launch PowerShell as an administrator.
2. Create the certificate by running the following cmdlet:

New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname “www.example.com” -NotAfter (Get-Date).AddMonths(60). Note this will create a certificate which expires only after five years.

3. Export the certificate to a file by running the following cmdlet:

Export-Certificate -Cert cert:\localMachine\my\<Thumbprint> -FilePath C:\CommerceShop.cer

To install this certificate

Double click on the certificate then click on install certificate -> Choose store location as Local Machine and in the next screen select store certificate on the following store and select trusted root certification authority.

Finish!!

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s