2017-08-14 1 views
1

Je suis en train de porter une extension Chrome existante vers Microsoft Edge. L'extension fonctionne lorsque je la charge en tant qu'extension temporaire dans Edge.Échec du signe d'extension Edge

Maintenant, je veux emballer et signer. Le package a été généré avec succès. Mais quand je tente de me connecter à l'aide de Windows App Certification Kit, il échoue avec l'erreur suivante:

Edge extension manifest.json 
Error Found: The JSON schema validation test detected the following errors: 
Validation failed: Data does not match any schemas from "anyOf" 
Schema location: /allOf/1/dependencies/background/anyOf 
Manifest location: 
Validation failed for extension manifest: Extension\manifest.json 
Impact if not fixed: Microsoft Edge extensions that violate the Windows Store certification requirements can’t be submitted to the Windows Store. 
How to fix: Extension’s manifest.json must include valid entries for all required and specified fields. Please resolve the entries and conflicts above. 

Les commandes que j'utilise pour emballer extension:

manifoldjs -l debug -p edgeextension -f edgeextension -m EdgeExtension\manifest.json 
manifoldjs -l debug -p edgeextension package Test\edgeextension\manifest\ 

Mon fichier manifeste:

{ 
    "author": "Test", 
    "background": { 
     "page": "Agent/Ext/bg-loader.html", 
     "persistent": false 
    }, 
    "content_scripts": [ 
     { 
      "matches": [ 
       "<all_urls>" 
      ], 
      "js": [ 
       "Agent/Content/contentLoader.js" 
      ], 
      "run_at": "document_start", 
      "all_frames": true 
     } 
    ], 
    "content_security_policy" : "script-src 'self'; object-src 'self'", 
    "default_locale" : "en", 
    "description": "Test Web Applications Using Google Chrome", 
    "name": "Test", 
    "permissions": [ 
     "nativeMessaging", 
     "webNavigation", 
     "webRequest", 
     "webRequestBlocking", 
     "tabs", 
     "cookies", 
     "browsingData", 
     "debugger", 
     "<all_urls>", 
     "notifications", 
     "unlimited_storage" 
    ], 
    "version": "1.0.0.0", 
    "-ms-preload": { 
     "backgroundScript": "backgroundScriptsAPIBridge.js", 
     "contentScript": "contentScriptsAPIBridge.js" 
    }, 
    "minimum_edge_version" : "33.14281.1000.0" 
} 

Répondre

1

Avec l'aide d'Alexey Sidorov de this thread, j'ai compris comment signer les extensions Edge.

Note: Please make sure do following steps in PowerShell, not command line.


1. Créer un certificat auto-signé

New-SelfSignedCertificate -Type Custom -Subject "CN=Contoso Software, O=Contoso Corporation, C=US" -KeyUsage DigitalSignature -FriendlyName <Your Friendly Name> -CertStoreLocation "Cert:\LocalMachine\My" 

Vous pouvez obtenir votre sujet dans votre identité App sur le site Microsoft Developer.

Le nom convivial peut être n'importe quelle chaîne.

2. le certificat d'exportation

Vérifiez thumbprint:

Set-Location Cert:\LocalMachine\My 
Get-ChildItem | Format-Table Subject, FriendlyName, Thumbprint 

Vous avez besoin d'un mot de passe pour l'exportation pour des raisons de sécurité.

$pwd = ConvertTo-SecureString -String <Your Password> -Force -AsPlainText 
Export-PfxCertificate -cert "Cert:\LocalMachine\My\<Certificate Thumbprint>" -FilePath <FilePath>.pfx -Password $pwd 

3. installer le certificat aux autorités de certification racine. Tapez "Gérer les certificats d'ordinateur" dans le menu Démarrer, accédez à Autorités de certification racine de confiance \ Certificats. Faites un clic droit dessus, Toutes les tâches, Importer Suivez l'assistant pour terminer l'importation.

4. Connexion l'application à l'aide SignTool (Le SignTool est installé avec Windows SDK 10 S'il vous plaît assurez-vous qu'il existe dans votre système PATH.)

Vérifier l'algorithme de hachage de votre extension:

Extrait AppxBlockMap.xml dans votre fichier .appx, vérifiez HashMethod:

<BlockMap xmlns="http://schemas.microsoft.com/appx/2010/blockmap" HashMethod="http://www.w3.org/2001/04/xmlenc#sha256"> 

l'algorithme de hachage est la valeur après #, par exemple, #sha256 signifie que vous utilisez SHA256 comme algorithme de hachage.

SignTool sign /fd <Hash Algorithm> /a /f <Path to Certificate>.pfx /p <Your Password> <File path>.appx 

5. Maintenant vous pouvez installer votre application en double-clic.


Références officielles:

Create a certificate for package signing

Sign an app package using SignTool