(key: crypto.KeyObject)
| 72 | } |
| 73 | |
| 74 | export function getSignatureType(key: crypto.KeyObject): SignatureType { |
| 75 | const signatureType = maybeGetSignatureType(key); |
| 76 | assert( |
| 77 | signatureType !== null, |
| 78 | 'Expected either "Ed25519" or "ECDSA P-256" key.' |
| 79 | ); |
| 80 | return signatureType; |
| 81 | } |
| 82 | |
| 83 | export function getPublicKeyAttributeName(key: crypto.KeyObject) { |
| 84 | return PUBLIC_KEY_ATTRIBUTE_NAME_MAPPING.get(getSignatureType(key))!; |
no test coverage detected