diff options
author | Matthew Miller <matthew@millerti.me> | 2020-09-07 23:59:45 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-09-07 23:59:45 -0700 |
commit | 8f0f9962ba4391862e34eca07c8c2674e70b482d (patch) | |
tree | dd81c519aa1d8fe8b6d036b6743584fcb7158448 /packages/server/src | |
parent | f44ac347d3508e24a64337e2af7c5856ddb7a59f (diff) |
Clean up convertCOSEtoPKCS
Diffstat (limited to 'packages/server/src')
-rw-r--r-- | packages/server/src/helpers/convertCOSEtoPKCS.ts | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/packages/server/src/helpers/convertCOSEtoPKCS.ts b/packages/server/src/helpers/convertCOSEtoPKCS.ts index aa61031..3119de5 100644 --- a/packages/server/src/helpers/convertCOSEtoPKCS.ts +++ b/packages/server/src/helpers/convertCOSEtoPKCS.ts @@ -3,27 +3,8 @@ import type { SigningSchemeHash } from 'node-rsa'; /** * Takes COSE-encoded public key and converts it to PKCS key - * - * @param cosePublicKey COSE-encoded public key - * @return RAW PKCS encoded public key */ export default function convertCOSEtoPKCS(cosePublicKey: Buffer): Buffer { - /* - +------+-------+-------+---------+----------------------------------+ - | name | key | label | type | description | - | | type | | | | - +------+-------+-------+---------+----------------------------------+ - | crv | 2 | -1 | int / | EC Curve identifier - Taken from | - | | | | tstr | the COSE Curves registry | - | | | | | | - | x | 2 | -2 | bstr | X Coordinate | - | | | | | | - | y | 2 | -3 | bstr / | Y Coordinate | - | | | | bool | | - | | | | | | - | d | 2 | -4 | bstr | Private key | - +------+-------+-------+---------+----------------------------------+ - */ const struct: COSEPublicKey = cbor.decodeFirstSync(cosePublicKey); const tag = Buffer.from([0x04]); |