import * as uint8arrays from "uint8arrays";
import { sha256Str } from "../../../crypto/index.js";
/**
 * Creates a share key.
 */
export function create({ counter, recipientExchangeDid, senderRootDid }) {
    return sha256Str(`${recipientExchangeDid}${senderRootDid}${counter}`);
}
/**
 * Creates the payload for a share key.
 */
export function payload({ entryIndexCid, symmKey, symmKeyAlgo }) {
    const cid = entryIndexCid;
    return {
        algo: symmKeyAlgo,
        key: typeof symmKey === "string"
            ? uint8arrays.fromString(symmKey, "base64pad")
            : symmKey,
        cid
    };
}
//# sourceMappingURL=key.js.map