I am working on a chrome extension to get access to the list of certificates on my browser (Including the class 3 certificate I purchased).
This is the manifest.json
{
"manifest_version": 2,
"name": "Coding Train Extension 2",
"version": "0.001",
"permissions": ["storage", "activeTab", "scripting"],
"content_scripts": [
{
"matches":["<all_urls>"],
"js": ["content.js"]
}
],
"background":{
"scripts": ["background.js"]
},
"browser_action":{
"default_icon": "logo.png"
}
}
This is the background.js
console.log("This is inside background...");
chrome.browserAction.onClicked.addListener(collectAvailableCertificates);
function collectAvailableCertificates() {
// Return all certificates that this Extension can currently provide.
// For example:
return [{
certificateChain: [new Uint8Array()],
supportedAlgorithms: ['RSASSA_PKCS1_v1_5_SHA256']
}];
}
In this test, the content.js is not being used much. I have an icon of the extension on browser and on its click I am triggering the background.js.
I am trying to emulate the APIs provided in the Chrome API documentation https://developer.chrome.com/docs/extensions/reference/certificateProvider/
How to call the methods like collectAvailableCertificates(), handleSignatureRequest(request) as seen in the document is what I am pursuing. My aim is to use this purchased certificate to digitally sign an xml payload.