|
2 | 2 | * Copyright (c) 2025 Digital Credentials Consortium.
|
3 | 3 | */
|
4 | 4 | export type IKeyPair = IVerificationKeyPair2018 | IVerificationKeyPair2020 |
|
5 |
| - IMultikeyPair | IJsonWebKeyPair2020 |
| 5 | + IMultikeyPair | IJsonWebKeyPair2020 | IJsonWebKeyPair |
6 | 6 |
|
7 | 7 | export type IPublicKey = IPublicKey2018 | IPublicKey2020 | IPublicMultikey
|
8 |
| - | IJsonWebPublicKey2020 |
| 8 | + | IJsonWebPublicKey |
9 | 9 |
|
10 | 10 | export interface IKeyPairCore {
|
11 | 11 | '@context'?: string
|
@@ -33,27 +33,38 @@ export interface IVerificationKeyPair2020 extends IPublicKey2020 {
|
33 | 33 | privateKeyMultibase?: string
|
34 | 34 | }
|
35 | 35 |
|
| 36 | +/** |
| 37 | + * @see https://www.w3.org/TR/cid-1.0/#Multikey |
| 38 | + */ |
36 | 39 | export interface IPublicMultikey extends IKeyPairCore {
|
37 | 40 | publicKeyMultibase?: string
|
38 | 41 | }
|
39 | 42 | export interface IMultikeyPair extends IPublicMultikey {
|
40 | 43 | secretKeyMultibase?: string
|
41 | 44 | }
|
42 | 45 |
|
43 |
| -export interface IJsonWebPublicKey2020 { |
| 46 | +export interface IJsonWebPublicKey { |
44 | 47 | // Used by JsonWebKey2020
|
45 | 48 | publicKeyJwk?: IJsonWebKey
|
46 | 49 | }
|
47 |
| -export interface IJsonWebKeyPair2020 extends IJsonWebPublicKey2020 { |
| 50 | +export interface IJsonWebKeyPair2020 extends IJsonWebPublicKey { |
48 | 51 | privateKeyJwk?: IJsonWebKey
|
49 | 52 | }
|
| 53 | +// @see https://www.w3.org/TR/cid-1.0/#JsonWebKey |
| 54 | +export interface IJsonWebKeyPair extends IJsonWebPublicKey { |
| 55 | + secretKeyJwk?: IJsonWebKey |
| 56 | +} |
| 57 | + |
50 | 58 | export interface IJsonWebKey {
|
51 | 59 | // Key type, e.g. 'RSA' or 'OKP'
|
52 | 60 | kty?: string
|
53 | 61 |
|
54 | 62 | // Curve, used by elliptic cryptography keys (kty: 'OKP'), e.g. 'Ed25519'
|
55 | 63 | crv?: string
|
56 | 64 |
|
| 65 | + // Algorithm, e.g. 'ES384' |
| 66 | + alg?: string |
| 67 | + |
57 | 68 | // Public key, typically base64url encoded
|
58 | 69 | x?: string
|
59 | 70 |
|
|
0 commit comments