(key: KeyObject)
| 28 | private readonly typeSuffix: number[]; |
| 29 | |
| 30 | constructor(key: KeyObject) { |
| 31 | if (!isAsymmetricKeyTypeSupported(key)) { |
| 32 | throw new Error( |
| 33 | `WebBundleId: Only Ed25519 and ECDSA P-256 keys are currently supported.` |
| 34 | ); |
| 35 | } |
| 36 | |
| 37 | if (key.type === 'private') { |
| 38 | this.key = crypto.createPublicKey(key); |
| 39 | } else { |
| 40 | this.key = key; |
| 41 | } |
| 42 | |
| 43 | this.typeSuffix = this.TYPE_SUFFIX_MAPPING.get(getSignatureType(this.key))!; |
| 44 | } |
| 45 | |
| 46 | getKeyTypeName(): string { |
| 47 | return this.TYPE_NAME_MAPPING.get(getSignatureType(this.key)) as string; |
nothing calls this directly
no test coverage detected