Skip to content

Commit

Permalink
Merge pull request #2 from Robin1985/revert-1-Robin1985-Add-function-…
Browse files Browse the repository at this point in the history
…for-dual-signing

Revert "Add function for dual signing"
  • Loading branch information
Robin1985 committed Apr 12, 2016
2 parents 5e009f4 + d86677a commit e751a81
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions src/app/FakeLib/SignToolHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -65,42 +65,6 @@ let Sign (toolsPath : string) (parameters : SignParams) (filesToSign : seq<strin
/// Signs all files in filesToSign with the certification file certFile,
/// protected with the password in the file passFile.
/// The signtool will be search in the toolPath.
let AppendSignature (toolsPath : string) (parameters : SignParams) (filesToSign : seq<string>) =
traceStartTask "SignTool" "Trying to dual sign the specified assemblies"

let signPath = toolsPath @@ "signtool.exe"

let certToUse = match parameters.Certificate with
| Some cert -> if File.Exists cert.CertFile then cert else parameters.DevCertificate
| None -> parameters.DevCertificate

let baseCall = sprintf "sign /f \"%s\" /as /fd sha256 " certToUse.CertFile


let withTimeStamp = baseCall + match parameters.TimeStampUrl with
| Some url -> sprintf " /tr \"%s\" /td sha256" url.AbsoluteUri
| None -> ""

let withPassword = withTimeStamp + match certToUse.PasswordFile with
| Some pass -> sprintf " /p \"%s\"" (ReadLine pass)
| None -> ""


filesToSign
|> Seq.iter (fun fileToSign ->
let withFileToSign = withPassword + sprintf " \"%s\"" fileToSign

let result =
ExecProcess (fun info ->
info.FileName <- signPath
info.Arguments <- withFileToSign) System.TimeSpan.MaxValue
if result <> 0 then failwithf "Error during sign call ")

traceEndTask "SignTool" "Successfully dual signed the specified assemblies"




[<Obsolete>]
let SignTool toolsPath certFile passFile filesToSign =
let certToUse = {
Expand All @@ -114,4 +78,4 @@ let SignTool toolsPath certFile passFile filesToSign =
TimeStampUrl = None
}

Sign toolsPath signParams filesToSign
Sign toolsPath signParams filesToSign

0 comments on commit e751a81

Please sign in to comment.