@sphereon/ssi-sdk-ext.key-utils 0.34.1-feature.merge.crypto.extensions.modules.33 → 0.34.1-feature.merge.crypto.extensions.modules.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +55 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +55 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/conversion.ts +55 -2
package/src/conversion.ts
CHANGED
|
@@ -125,7 +125,38 @@ export function joseToCoseSignatureAlg(joseAlg: JoseSignatureAlgorithm | JoseSig
|
|
|
125
125
|
return ICoseSignatureAlgorithm.HS384
|
|
126
126
|
case (JoseSignatureAlgorithm.HS512, 'HS512'):
|
|
127
127
|
return ICoseSignatureAlgorithm.HS512
|
|
128
|
-
case
|
|
128
|
+
case JoseSignatureAlgorithm.ES256K:
|
|
129
|
+
case 'ES256K':
|
|
130
|
+
return ICoseSignatureAlgorithm.ES256K
|
|
131
|
+
case JoseSignatureAlgorithm.ES256:
|
|
132
|
+
case 'ES256':
|
|
133
|
+
return ICoseSignatureAlgorithm.ES256
|
|
134
|
+
case JoseSignatureAlgorithm.ES384:
|
|
135
|
+
case 'ES384':
|
|
136
|
+
return ICoseSignatureAlgorithm.ES384
|
|
137
|
+
case JoseSignatureAlgorithm.ES512:
|
|
138
|
+
case 'ES512':
|
|
139
|
+
return ICoseSignatureAlgorithm.ES512
|
|
140
|
+
case JoseSignatureAlgorithm.PS256:
|
|
141
|
+
case 'PS256':
|
|
142
|
+
return ICoseSignatureAlgorithm.PS256
|
|
143
|
+
case JoseSignatureAlgorithm.PS384:
|
|
144
|
+
case 'PS384':
|
|
145
|
+
return ICoseSignatureAlgorithm.PS384
|
|
146
|
+
case JoseSignatureAlgorithm.PS512:
|
|
147
|
+
case 'PS512':
|
|
148
|
+
return ICoseSignatureAlgorithm.PS512
|
|
149
|
+
case JoseSignatureAlgorithm.HS256:
|
|
150
|
+
case 'HS256':
|
|
151
|
+
return ICoseSignatureAlgorithm.HS256
|
|
152
|
+
case JoseSignatureAlgorithm.HS384:
|
|
153
|
+
case 'HS384':
|
|
154
|
+
return ICoseSignatureAlgorithm.HS384
|
|
155
|
+
case JoseSignatureAlgorithm.HS512:
|
|
156
|
+
case 'HS512':
|
|
157
|
+
return ICoseSignatureAlgorithm.HS512
|
|
158
|
+
case JoseSignatureAlgorithm.EdDSA:
|
|
159
|
+
case 'EdDSA':
|
|
129
160
|
return ICoseSignatureAlgorithm.EdDSA
|
|
130
161
|
default:
|
|
131
162
|
throw Error(`Signature algorithm ${joseAlg} not supported in Cose`)
|
|
@@ -148,7 +179,29 @@ export function joseToCoseKeyOperation(keyOp: JoseKeyOperation | JoseKeyOperatio
|
|
|
148
179
|
return ICoseKeyOperation.UNWRAP_KEY
|
|
149
180
|
case (JoseKeyOperation.DERIVE_KEY, 'deriveKey'):
|
|
150
181
|
return ICoseKeyOperation.DERIVE_KEY
|
|
151
|
-
case
|
|
182
|
+
case JoseKeyOperation.SIGN:
|
|
183
|
+
case 'sign':
|
|
184
|
+
return ICoseKeyOperation.SIGN
|
|
185
|
+
case JoseKeyOperation.VERIFY:
|
|
186
|
+
case 'verify':
|
|
187
|
+
return ICoseKeyOperation.VERIFY
|
|
188
|
+
case JoseKeyOperation.ENCRYPT:
|
|
189
|
+
case 'encrypt':
|
|
190
|
+
return ICoseKeyOperation.ENCRYPT
|
|
191
|
+
case JoseKeyOperation.DECRYPT:
|
|
192
|
+
case 'decrypt':
|
|
193
|
+
return ICoseKeyOperation.DECRYPT
|
|
194
|
+
case JoseKeyOperation.WRAP_KEY:
|
|
195
|
+
case 'wrapKey':
|
|
196
|
+
return ICoseKeyOperation.WRAP_KEY
|
|
197
|
+
case JoseKeyOperation.UNWRAP_KEY:
|
|
198
|
+
case 'unwrapKey':
|
|
199
|
+
return ICoseKeyOperation.UNWRAP_KEY
|
|
200
|
+
case JoseKeyOperation.DERIVE_KEY:
|
|
201
|
+
case 'deriveKey':
|
|
202
|
+
return ICoseKeyOperation.DERIVE_KEY
|
|
203
|
+
case JoseKeyOperation.DERIVE_BITS:
|
|
204
|
+
case 'deriveBits':
|
|
152
205
|
return ICoseKeyOperation.DERIVE_BITS
|
|
153
206
|
default:
|
|
154
207
|
throw Error(`Key operation ${keyOp} not supported in Cose`)
|