blob: bb5dab4eed0e19f6c7ed4cb4b366baa5bb28afd2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import { COSEPublicKey } from "./cose.ts";
import { isoCBOR } from "./iso/index.ts";
export function decodeCredentialPublicKey(
publicKey: Uint8Array,
): COSEPublicKey {
return _decodeCredentialPublicKeyInternals.stubThis(
isoCBOR.decodeFirst<COSEPublicKey>(publicKey),
);
}
// Make it possible to stub the return value during testing
export const _decodeCredentialPublicKeyInternals = {
stubThis: (value: COSEPublicKey) => value,
};
|