Skip to content

Commit

Permalink
fix(Certificate): Cap expiry date at issuer's (#430)
Browse files Browse the repository at this point in the history
Not only is this semantically correct, but it helps with certificate rotation as subjects can simply check their own expiry dates without looking at the rest of the chain.
  • Loading branch information
gnarea authored Mar 17, 2022
1 parent 43e5cda commit 38d9d65
Show file tree
Hide file tree
Showing 7 changed files with 203 additions and 161 deletions.
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@types/verror": "^1.10.5",
"asn1js": "^2.2.0",
"buffer-to-arraybuffer": "0.0.6",
"date-fns": "^2.28.0",
"dohdec": "^3.1.0",
"is-valid-domain": "^0.1.6",
"moment": "^2.29.1",
Expand All @@ -59,7 +60,6 @@
"@types/asn1js": "2.0.2",
"@types/jest": "^27.4.1",
"@types/pkijs": "0.0.12",
"date-fns": "^2.28.0",
"del-cli": "^4.0.1",
"jest": "^27.5.1",
"jest-date-mock": "^1.0.8",
Expand Down
3 changes: 3 additions & 0 deletions src/lib/_test_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ interface StubCertConfig {
readonly subjectPublicKey: CryptoKey;
}

/**
* @deprecated Use {Certificate.issue} instead
*/
export async function generateStubCert(config: Partial<StubCertConfig> = {}): Promise<Certificate> {
const keyPair = await generateRSAKeyPair();
const futureDate = new Date();
Expand Down
Loading

0 comments on commit 38d9d65

Please sign in to comment.