-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from amphineko/feat-sqlite-pki
Use SQLite as storage backend for PKI
- Loading branch information
Showing
42 changed files
with
1,393 additions
and
1,037 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/common/types/MPSK.ts → packages/common/types/mpsks/MPSK.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as t from "io-ts" | ||
|
||
import { RelativeDistinguishedNames, RelativeDistinguishedNamesType } from "./RelativeDistinguishedNames" | ||
import { SerialNumberString, SerialNumberStringType } from "./SerialNumberString" | ||
import { DateFromUnixTimestamp } from "../Date" | ||
|
||
/** | ||
* Metadata extracted from a certificate | ||
* For storage lookup without needing to parse the entire certificate. | ||
*/ | ||
export interface CertificateMetadata { | ||
readonly subject: RelativeDistinguishedNames | ||
readonly serialNumber: SerialNumberString | ||
|
||
readonly notBefore: Date | ||
readonly notAfter: Date | ||
} | ||
|
||
export interface EncodedCertificateMetadata { | ||
subject: RelativeDistinguishedNames | ||
serialNumber: string | ||
|
||
notBefore: number | ||
notAfter: number | ||
} | ||
|
||
export const CertificateMetadataType: t.Type<CertificateMetadata, EncodedCertificateMetadata> = t.type({ | ||
subject: RelativeDistinguishedNamesType, | ||
serialNumber: SerialNumberStringType, | ||
|
||
notBefore: DateFromUnixTimestamp, | ||
notAfter: DateFromUnixTimestamp, | ||
}) |
2 changes: 1 addition & 1 deletion
2
...ommon/types/RelativeDistinguishedNames.ts → ...n/types/pki/RelativeDistinguishedNames.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
packages/common/types/PKI.ts → packages/common/types/pki/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
export type KeyGenParams = EcKeyGenParams | RsaHashedKeyGenParams | ||
|
||
export type HashAlgorithm = "SHA-256" | "SHA-384" | "SHA-512" | ||
|
||
export interface PkiMode { | ||
certHashAlg: HashAlgorithm | ||
key: KeyGenParams | ||
key: EcKeyGenParams | RsaHashedKeyGenParams | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.