File tree Expand file tree Collapse file tree 5 files changed +177
-184
lines changed Expand file tree Collapse file tree 5 files changed +177
-184
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { Nullable } from "@hazae41/option"
10
10
export namespace CCADB {
11
11
12
12
export interface Trusted {
13
- readonly publicKeyHex : string
13
+ readonly certHex : string
14
14
readonly notAfter ?: string
15
15
}
16
16
@@ -40,16 +40,15 @@ export namespace CCADB {
40
40
const x509 = X509 . readAndResolveFromBytesOrThrow ( X509 . Certificate , pem )
41
41
42
42
const issuer = x509 . tbsCertificate . issuer . toX501OrThrow ( )
43
- const publicKey = X509 . writeToBytesOrThrow ( x509 . tbsCertificate . subjectPublicKeyInfo )
44
- const publicKeyHex = Buffer . from ( publicKey ) . toString ( "hex" )
43
+ const certHex = Buffer . from ( pem ) . toString ( "hex" )
45
44
46
45
if ( trusteds [ issuer ] )
47
46
console . warn ( `Duplicate issuer: ${ issuer } ` )
48
47
49
48
if ( notAfter )
50
- trusteds [ issuer ] = { notAfter, publicKeyHex }
49
+ trusteds [ issuer ] = { notAfter, certHex }
51
50
else
52
- trusteds [ issuer ] = { publicKeyHex }
51
+ trusteds [ issuer ] = { certHex }
53
52
} catch ( e : unknown ) {
54
53
console . warn ( e )
55
54
}
You can’t perform that action at this time.
0 commit comments