Comments (2)
This is the nsIX509CertValidity
object generated on my machine (Linux, en-US) from GitHub's certificate:
{
"notBefore": 1457568000000000,
"notBeforeLocalTime": "Wed 09 Mar 2016 04:00:00 PM PST",
"notBeforeLocalDay": "03/09/2016",
"notBeforeGMT": "Thu 10 Mar 2016 12:00:00 AM PST",
"notAfter": 1526558400000000,
"notAfterLocalTime": "Thu 17 May 2018 05:00:00 AM PST",
"notAfterLocalDay": "05/17/2018",
"notAfterGMT": "Thu 17 May 2018 12:00:00 PM PST"
}
CipherFox uses the notBeforeLocalDay
and notAfterLocalDay
keys to populate the $CERTISSUED
and $CERTEXP
formatting variables, respectively. Not all locales will present these in such a short format. This is the nsIX509CertValidity
object generated by a Windows en-US machine from the same certificate:
{
"notBefore": 1457568000000000,
"notBeforeLocalTime": "Wednesday, March 9, 2016 4:00:00 PM",
"notBeforeLocalDay": "Wednesday, March 9, 2016",
"notBeforeGMT": "Thursday, March 10, 2016 12:00:00 AM",
"notAfter": 1526558400000000,
"notAfterLocalTime": "Thursday, May 17, 2018 5:00:00 AM",
"notAfterLocalDay": "Thursday, May 17, 2018",
"notAfterGMT": "Thursday, May 17, 2018 12:00:00 PM"
}
Instead, we can parse a new date object from the notBefore
and notAfter
timestamps (ยตs since the epoch).
from cipherfox.
I think Date.prototype.toLocaleDateString
may get us a consistently short, localized format:
var d = new Date(cert.validity.notBefore / 1000);
// all locales currently supported by CipherFox
[
'de-DE', 'en-US', 'es-ES', 'fr-FR',
'hu-HU', 'ja-JP', 'ko-KR', 'ru-RU',
'zh-CN', 'zh-TW'
].forEach(function(locale) {
console.log(locale, d.toLocaleDateString(locale));
});
de-DE 9.3.2016
en-US 3/9/2016
es-ES 9/3/2016
fr-FR 09/03/2016
hu-HU 2016. 03. 09.
ja-JP 2016/3/9
ko-KR 2016. 3. 9.
ru-RU 09.03.2016
zh-CN 2016/3/9
zh-TW 2016/3/9
from cipherfox.
Related Issues (20)
- Add support for Pale Moon HOT 3
- Remove "(Firefox XX+)" from cipherSuite.label and protocol.label HOT 4
- Site ID dialog width is not enough HOT 17
- Cipherfox dropdown in site ID dialog is gone in Firefox 42 HOT 1
- Make statusbar item moveable HOT 2
- New Firefox 43 box does not expand to full size HOT 2
- Add support for e10s
- Questionmarks for chiper size, type, hash, and other values HOT 44
- Remove RC4-Option HOT 3
- Cipherfox with partial https HOT 1
- Mark extension as compatible with e10s
- Add support for TLS 1.3 HOT 7
- "Qualys SSL Labs Server Test" does not work on Fx 51+ HOT 6
- Enhancement request: Switch from SSL labs test to new Observatory by Mozilla HOT 4
- WebExtensions Support HOT 14
- Questionmarks for chiper size, type, hash, and other values HOT 3
- Add support for TLS 1.3 protocol HOT 4
- Error thrown with cipherfox 4.1.1 in Pale Moon 27.5.* HOT 3
- Update for Firefox 57 support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cipherfox.