Skip to content

Commit d7d530e

Browse files
committed
update certificate
1 parent 779e52b commit d7d530e

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

deno.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tls/enum",
3-
"version": "0.3.3",
3+
"version": "0.3.4",
44
"exports": "./src/mod.ts",
55
"publish": {
66
"exclude": ["dist/"]
@@ -14,9 +14,10 @@
1414
},
1515
"imports": {
1616
"@noble/curves": "npm:@noble/curves@^1.7.0",
17+
"@peculiar/x509": "npm:@peculiar/x509@^1.12.3",
1718
"@std/assert": "jsr:@std/assert@^1.0.2",
18-
"@tls/extension": "jsr:@tls/extension@^0.2.0",
19-
"@tls/record": "jsr:@tls/record@^0.0.6",
19+
"@tls/extension": "jsr:@tls/extension@^0.2.1",
20+
"@tls/record": "jsr:@tls/record@^0.0.7",
2021
"@tls/struct": "jsr:@tls/struct@^0.3.1"
2122
}
2223
}

src/certificatetype.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import { Enum } from "./enum.js";
55
import { Constrained, Struct, Uint24, Uint8, Uint16, Extension } from "./dep.ts"
6+
import { x509 } from "./dep.ts";
67

78
/**
89
* Supported groups - @see https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.7.
@@ -41,6 +42,7 @@ export class CertificateEntry extends Uint8Array {
4142
super(struct);
4243
this.opaque = opaque;
4344
this.extension = extension
45+
this.x509 = new x509.X509Certificate(btoa(String.fromCharCode(...opaque)))
4446
}
4547
}
4648

src/dep.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ export { x448 } from '@noble/curves/ed448'
99
export * as utils from "@noble/curves/abstract/utils"
1010
export { TLSPlaintext } from "@tls/record"
1111
export { HexaDecimal } from "@tls/struct"
12+
export * as x509 from "@peculiar/x509"
1213

test/certificate_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ const test = Handshake.from(HexaDecimal.fromString(`0b 00 01 b9 00 00 01 b5 00 0
2525
1c 3b 84 e0 a8 b2 f7 59 40 9b a3 ea c9 d9 1d 40 2d cc 0c c8 f8
2626
96 12 29 ac 91 87 b4 2b 4d e1 00 00`).byte)
2727

28-
const certificate = Certificate.from(test.message)
28+
const certificate = Certificate.from(test.message)

0 commit comments

Comments
 (0)