PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.win.server.scripting > Re: Sign a script
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: Sign a script

Réponse
 
LinkBack Outils de la discussion
Vieux 22/11/2007, 21h46   #1
Michael Harris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sign a script

Troy wrote:
> I am attempting to sign a script for the first time and receiving an
> error.
> I have installed a Code Signing certificate from my Enterprise Root
> CA in my personal certificate store ("My"). I am using a slightly
> modified version of the Script Center's "Sign a Script
> Programmatically.vbs" script, with the only differences being the
> file name, the path, and the name of the certificate. Everytime that
> I attempt to run the "Sign a Script Programmatically.vbs" script, I
> receive the following error: "(null): Unspecified error".
>
> The name of my code signing certificate is "Lastname, Troy" and I
> believe that the comma might be causing the problem as I successfully
> signed a script with a test account with no comma in the display
> name. Can anyone verify this and if so, is there a way around it? I
> have tried "Lastname\, Troy".
>


Have you tried the *.wsf version from the WSH docs (saved as
ScriptSigner.wsf)?

Run: ScriptSigner.wsf /file:"c:\path to\some.vbs" /cert:"Lastname, Troy"

<job>
<runtime>
<named name="file" string="the file to sign" required="true"
type="string"/>
<named name="cert" string="the name of the signing certificate"
required="true" type="string"/>
<named name="store" string="the name of the certificate store"
required="false" type="string"/>
</runtime>
<script language="vbscript">
Dim Signer, File, Cert, Store
If Not (WScript.Arguments.Named.Exists("cert") And
WScript.Arguments.Named.Exists("file")) Then
WScript.Arguments.ShowUsage
WScript.Quit
End If
Set Signer = CreateObject("Scripting.Signer")
File = WScript.Arguments.Named("file")
Cert = WScript.Arguments.Named("cert")
If WScript.Arguments.Named.Exists("store") Then
Store = WScript.Arguments.Named("store")
Else
Store = "my"
End If
Signer.SignFile File, Cert, Store
</script>
</job>



--
Michael Harris


  Réponse avec citation
Vieux 23/11/2007, 16h28   #2
Troy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sign a script

Thanks much for the script, but unfortunately I still receive the "(null):
Unspecified error". Any other ideas?

"Michael Harris" wrote:

> Troy wrote:
> > I am attempting to sign a script for the first time and receiving an
> > error.
> > I have installed a Code Signing certificate from my Enterprise Root
> > CA in my personal certificate store ("My"). I am using a slightly
> > modified version of the Script Center's "Sign a Script
> > Programmatically.vbs" script, with the only differences being the
> > file name, the path, and the name of the certificate. Everytime that
> > I attempt to run the "Sign a Script Programmatically.vbs" script, I
> > receive the following error: "(null): Unspecified error".
> >
> > The name of my code signing certificate is "Lastname, Troy" and I
> > believe that the comma might be causing the problem as I successfully
> > signed a script with a test account with no comma in the display
> > name. Can anyone verify this and if so, is there a way around it? I
> > have tried "Lastname\, Troy".
> >

>
> Have you tried the *.wsf version from the WSH docs (saved as
> ScriptSigner.wsf)?
>
> Run: ScriptSigner.wsf /file:"c:\path to\some.vbs" /cert:"Lastname, Troy"
>
> <job>
> <runtime>
> <named name="file" string="the file to sign" required="true"
> type="string"/>
> <named name="cert" string="the name of the signing certificate"
> required="true" type="string"/>
> <named name="store" string="the name of the certificate store"
> required="false" type="string"/>
> </runtime>
> <script language="vbscript">
> Dim Signer, File, Cert, Store
> If Not (WScript.Arguments.Named.Exists("cert") And
> WScript.Arguments.Named.Exists("file")) Then
> WScript.Arguments.ShowUsage
> WScript.Quit
> End If
> Set Signer = CreateObject("Scripting.Signer")
> File = WScript.Arguments.Named("file")
> Cert = WScript.Arguments.Named("cert")
> If WScript.Arguments.Named.Exists("store") Then
> Store = WScript.Arguments.Named("store")
> Else
> Store = "my"
> End If
> Signer.SignFile File, Cert, Store
> </script>
> </job>
>
>
>
> --
> Michael Harris
>
>
>

  Réponse avec citation
Vieux 23/11/2007, 16h53   #3
Troy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sign a script

I just tried renaming my test account to "Test, Troy" exporting then deleting
the old certificate, and downloading a new one named "Test, Troy" and I was
able to sign another file, so I think that my user profile might be corrupt.
???

"Michael Harris" wrote:

> Troy wrote:
> > I am attempting to sign a script for the first time and receiving an
> > error.
> > I have installed a Code Signing certificate from my Enterprise Root
> > CA in my personal certificate store ("My"). I am using a slightly
> > modified version of the Script Center's "Sign a Script
> > Programmatically.vbs" script, with the only differences being the
> > file name, the path, and the name of the certificate. Everytime that
> > I attempt to run the "Sign a Script Programmatically.vbs" script, I
> > receive the following error: "(null): Unspecified error".
> >
> > The name of my code signing certificate is "Lastname, Troy" and I
> > believe that the comma might be causing the problem as I successfully
> > signed a script with a test account with no comma in the display
> > name. Can anyone verify this and if so, is there a way around it? I
> > have tried "Lastname\, Troy".
> >

>
> Have you tried the *.wsf version from the WSH docs (saved as
> ScriptSigner.wsf)?
>
> Run: ScriptSigner.wsf /file:"c:\path to\some.vbs" /cert:"Lastname, Troy"
>
> <job>
> <runtime>
> <named name="file" string="the file to sign" required="true"
> type="string"/>
> <named name="cert" string="the name of the signing certificate"
> required="true" type="string"/>
> <named name="store" string="the name of the certificate store"
> required="false" type="string"/>
> </runtime>
> <script language="vbscript">
> Dim Signer, File, Cert, Store
> If Not (WScript.Arguments.Named.Exists("cert") And
> WScript.Arguments.Named.Exists("file")) Then
> WScript.Arguments.ShowUsage
> WScript.Quit
> End If
> Set Signer = CreateObject("Scripting.Signer")
> File = WScript.Arguments.Named("file")
> Cert = WScript.Arguments.Named("cert")
> If WScript.Arguments.Named.Exists("store") Then
> Store = WScript.Arguments.Named("store")
> Else
> Store = "my"
> End If
> Signer.SignFile File, Cert, Store
> </script>
> </job>
>
>
>
> --
> Michael Harris
>
>
>

  Réponse avec citation
Vieux 23/11/2007, 18h00   #4
Troy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sign a script

Okay, I've got it figured out. Through testing, I found that the cause of
the unspecified error is that I had multiple certificates from the same CA in
my personal certificate store (eg: Administrator and Code Signing). It
didn't matter that they were different template types or what the friendly
name was. When I exported the Administrator certificate and deleted it out
of the Personal certificate store, where I only had the one Code Signing
certificate from my Enterprise Root CA in my Personal certificate store, I
was able to sign my script successfully. If anyone knows a way around this
other than creating a v2 certificate to include the functionality of both
templates (my CA is 2003 Std unfortunately), that would be awesome;
otherwise, I can get by with this workaround.

Thanks for your input Michael.

"Troy" wrote:

> I just tried renaming my test account to "Test, Troy" exporting then deleting
> the old certificate, and downloading a new one named "Test, Troy" and I was
> able to sign another file, so I think that my user profile might be corrupt.
> ???
>
> "Michael Harris" wrote:
>
> > Troy wrote:
> > > I am attempting to sign a script for the first time and receiving an
> > > error.
> > > I have installed a Code Signing certificate from my Enterprise Root
> > > CA in my personal certificate store ("My"). I am using a slightly
> > > modified version of the Script Center's "Sign a Script
> > > Programmatically.vbs" script, with the only differences being the
> > > file name, the path, and the name of the certificate. Everytime that
> > > I attempt to run the "Sign a Script Programmatically.vbs" script, I
> > > receive the following error: "(null): Unspecified error".
> > >
> > > The name of my code signing certificate is "Lastname, Troy" and I
> > > believe that the comma might be causing the problem as I successfully
> > > signed a script with a test account with no comma in the display
> > > name. Can anyone verify this and if so, is there a way around it? I
> > > have tried "Lastname\, Troy".
> > >

> >
> > Have you tried the *.wsf version from the WSH docs (saved as
> > ScriptSigner.wsf)?
> >
> > Run: ScriptSigner.wsf /file:"c:\path to\some.vbs" /cert:"Lastname, Troy"
> >
> > <job>
> > <runtime>
> > <named name="file" string="the file to sign" required="true"
> > type="string"/>
> > <named name="cert" string="the name of the signing certificate"
> > required="true" type="string"/>
> > <named name="store" string="the name of the certificate store"
> > required="false" type="string"/>
> > </runtime>
> > <script language="vbscript">
> > Dim Signer, File, Cert, Store
> > If Not (WScript.Arguments.Named.Exists("cert") And
> > WScript.Arguments.Named.Exists("file")) Then
> > WScript.Arguments.ShowUsage
> > WScript.Quit
> > End If
> > Set Signer = CreateObject("Scripting.Signer")
> > File = WScript.Arguments.Named("file")
> > Cert = WScript.Arguments.Named("cert")
> > If WScript.Arguments.Named.Exists("store") Then
> > Store = WScript.Arguments.Named("store")
> > Else
> > Store = "my"
> > End If
> > Signer.SignFile File, Cert, Store
> > </script>
> > </job>
> >
> >
> >
> > --
> > Michael Harris
> >
> >
> >

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h00.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,93955 seconds with 12 queries