Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. @573 573 revised this gist Sep 19, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions FirstSteps_With_The_Signature.ps1
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    get-help Set-AuthenticodeSignature -detailed
    get-help Set-ExecutionPolicy -detailed
    Set-ExecutionPolicy remotesigned
    $cert = Get-PfxCertificate ~\Documents\Outlook-Dateien\codesign.pfx
    Set-AuthenticodeSignature -FilePath .\Microsoft.PowerShell_profile.ps1 -Certificate $cert -IncludeChain Signer
  2. @573 573 revised this gist Sep 19, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions FirstSteps_With_The_Signature.ps1
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,3 @@
    get-help Set-AuthenticodeSignature -detailed
    $cert = Get-PfxCertificate ~\Documents\Outlook-Dateien\codesign.pfx
    Set-AuthenticodeSignature -FilePath .\Microsoft.PowerShell_profile.ps1 -Certificate $cert -IncludeChain Signer
  3. @573 573 revised this gist Sep 19, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions FirstSteps_With_The_Signature.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    $cert = Get-PfxCertificate ~\Documents\Outlook-Dateien\codesign.pfx
    Set-AuthenticodeSignature -FilePath .\Microsoft.PowerShell_profile.ps1 -Certificate $cert -IncludeChain Signer
  4. @573 573 revised this gist Sep 19, 2014. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion makeauthority.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Run this once

    # Borrowed from
    # Borrowed from http://bit.do/SwCv

    openssl genrsa -des3 -out ca.key 4096
    openssl req -config /c/Program\ Files\ \(x86\)/Git/ssl/openssl.cnf -new -x509 -days 365 -out ca.crt -key ca.key
    2 changes: 1 addition & 1 deletion makecert.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Run this for each code developer account. The system must install the CA cert and the resulting p12 file in order to be happy.

    # Borrowed from
    # Borrowed from http://bit.do/SwCv

    openssl genrsa -des3 -out codesign.key 4096
    openssl req -config /c/Program\ Files\ \(x86\)/Git/ssl/openssl.cnf -new -out codesign.csr -key codesign.key -reqexts v3_req
  5. @573 573 revised this gist Sep 19, 2014. 4 changed files with 33 additions and 7 deletions.
    18 changes: 18 additions & 0 deletions C:\Program Files (x86)\Git\ssl\openssl.cnf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    # -------------- In my case it was this location, change accordingly -----------
    # I only show here the part of that file I changed
    ## [ v3_req ]
    ##
    ### Extensions to add to a certificate request
    ##
    ##basicConstraints = CA:FALSE
    ##keyUsage = nonRepudiation, digitalSignature, keyEncipherment

    [ v3_req ]

    # Extensions to add to a certificate request

    subjectKeyIdentifier=hash
    basicConstraints = CA:FALSE
    keyUsage = digitalSignature
    extendedKeyUsage = codeSigning, msCodeInd, msCodeCom
    nsCertType = client, email, objsign
    5 changes: 4 additions & 1 deletion makeauthority.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    # Run this once

    # Borrowed from

    openssl genrsa -des3 -out ca.key 4096
    openssl req -new -x509 -days 365 -key ca.key -out ca.crt
    openssl req -config /c/Program\ Files\ \(x86\)/Git/ssl/openssl.cnf -new -x509 -days 365 -out ca.crt -key ca.key
    12 changes: 6 additions & 6 deletions makecert.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    # Run this for each email account. The system must install the CA cert and the resulting p12 file in order to be happy.
    # Run this for each code developer account. The system must install the CA cert and the resulting p12 file in order to be happy.

    # Borrowed from http://serverfault.com/questions/103263/can-i-create-my-own-s-mime-certificate-for-email-encryption
    # Borrowed from

    openssl genrsa -des3 -out smime.key 4096
    openssl req -new -key smime.key -out smime.csr
    openssl x509 -req -days 365 -in smime.csr -CA ca.crt -CAkey ca.key -set_serial 1 -out smime.crt -setalias "Self Signed SMIME" -addtrust emailProtection -addreject clientAuth -addreject serverAuth -trustout
    openssl pkcs12 -export -in smime.crt -inkey smime.key -out smime.p12
    openssl genrsa -des3 -out codesign.key 4096
    openssl req -config /c/Program\ Files\ \(x86\)/Git/ssl/openssl.cnf -new -out codesign.csr -key codesign.key -reqexts v3_req
    openssl x509 -req -days 365 -in codesign.csr -CA ca.crt -CAkey ca.key -extfile ~/v3.cfg -set_serial 01 -out codesign.crt
    openssl pkcs12 -export -in codesign.crt -inkey codesign.key -out codesign.pfx
    5 changes: 5 additions & 0 deletions ~\v3.cfg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    basicConstraints = CA:FALSE
    subjectKeyIdentifier=hash
    keyUsage = digitalSignature
    extendedKeyUsage = codeSigning, msCodeInd, msCodeCom
    nsCertType = client, email, objsign
  6. @richieforeman richieforeman revised this gist Jul 23, 2012. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions makecert.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,7 @@
    # Run this for each email account
    # Run this for each email account. The system must install the CA cert and the resulting p12 file in order to be happy.

    # Borrowed from http://serverfault.com/questions/103263/can-i-create-my-own-s-mime-certificate-for-email-encryption


    openssl genrsa -des3 -out smime.key 4096
    openssl req -new -key smime.key -out smime.csr
    openssl x509 -req -days 365 -in smime.csr -CA ca.crt -CAkey ca.key -set_serial 1 -out smime.crt -setalias "Self Signed SMIME" -addtrust emailProtection -addreject clientAuth -addreject serverAuth -trustout
  7. @richieforeman richieforeman revised this gist Jul 23, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion makeauthority.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    # Run this one
    # Run this once
    openssl genrsa -des3 -out ca.key 4096
    openssl req -new -x509 -days 365 -key ca.key -out ca.crt
  8. @richieforeman richieforeman created this gist Jul 23, 2012.
    3 changes: 3 additions & 0 deletions makeauthority.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    # Run this one
    openssl genrsa -des3 -out ca.key 4096
    openssl req -new -x509 -days 365 -key ca.key -out ca.crt
    9 changes: 9 additions & 0 deletions makecert.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    # Run this for each email account

    # Borrowed from http://serverfault.com/questions/103263/can-i-create-my-own-s-mime-certificate-for-email-encryption


    openssl genrsa -des3 -out smime.key 4096
    openssl req -new -key smime.key -out smime.csr
    openssl x509 -req -days 365 -in smime.csr -CA ca.crt -CAkey ca.key -set_serial 1 -out smime.crt -setalias "Self Signed SMIME" -addtrust emailProtection -addreject clientAuth -addreject serverAuth -trustout
    openssl pkcs12 -export -in smime.crt -inkey smime.key -out smime.p12