Skip to content

Commit b516691

Browse files
committed
CryptographicKey now can contain PEM-PKCS#1 key
Close #209
1 parent 5609c37 commit b516691

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ To be released.
1111
- Fedify now accepts PEM-PKCS#1 besides PEM-SPKI for RSA public keys.
1212
[[#209]]
1313

14+
- `CryptographicKey` now can contain a `publicKey` with a PEM-PKCS#1
15+
format (in addition to PEM-SPKI).
1416
- Added `importPkcs1()` function.
1517
- Added `importPem()` function.
1618

src/codegen/__snapshots__/class.test.ts.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { decode as decodeMultibase, encode as encodeMultibase }
1515
import {
1616
exportSpki,
1717
exportMultibaseKey,
18-
importSpki,
18+
importPem,
1919
importMultibaseKey,
2020
} from \\"../runtime/key.ts\\";
2121
import { LanguageString } from \\"../runtime/langstr.ts\\";
@@ -15371,7 +15371,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi
1537115371
: _2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem__array
1537215372
) {
1537315373
if (v == null) continue;
15374-
_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.push(await importSpki(v[\\"@value\\"]))
15374+
_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem.push(await importPem(v[\\"@value\\"]))
1537515375
}
1537615376
instance.#_2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem = _2fE2QMDdg6KFGqa4NEC3TmjApSAD_publicKeyPem;
1537715377

src/codegen/class.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export async function* generateClasses(
118118
yield `import {
119119
exportSpki,
120120
exportMultibaseKey,
121-
importSpki,
121+
importPem,
122122
importMultibaseKey,
123123
} from "${runtimePath}/key.ts";\n`;
124124
yield `import { LanguageString } from "${runtimePath}/langstr.ts";\n`;

src/codegen/type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ const scalarTypes: Record<string, ScalarType> = {
313313
&& typeof ${v}["@value"] === "string"`;
314314
},
315315
decoder(v) {
316-
return `await importSpki(${v}["@value"])`;
316+
return `await importPem(${v}["@value"])`;
317317
},
318318
},
319319
"fedify:multibaseKey": {

0 commit comments

Comments
 (0)