@sphereon/ssi-sdk.ebsi-support
Version:
60 lines • 2.91 kB
TypeScript
import { IAgentContext, IKey, IKeyManager, MinimalImportableKey, TKeyType } from '@veramo/core';
import { ApiOpts, EbsiApiVersion, EbsiEnvironment, IRequiredContext, WellknownOpts } from '../types/IEbsiSupport';
import { CreateEbsiDidOnLedgerResult, CreateEbsiDidParams, EbsiDidRegistryAPIEndpoints, EbsiDidSpecInfo, EbsiKeyType, EbsiPublicKeyPurpose, EbsiRPCResponse, IContext, IKeyOpts, RpcMethodArgs } from './types';
export declare function generateEbsiMethodSpecificId(specInfo?: EbsiDidSpecInfo): string;
export declare function generateOrUseProvidedEbsiPrivateKeyHex(specInfo?: EbsiDidSpecInfo, privateKeyBytes?: Uint8Array): string;
/**
* Returns the public key in the correct format to be used with the did registry v5
* - in case of Secp256k1 - returns the uncompressed public key as hex string prefixed with 0x04
* - in case of Secp256r1 - returns the jwk public key as hex string
* @param {{ key: IKey, type: EbsiKeyType }} args
* - key is the cryptographic key containing the public key
* - type is the type of the key which can be Secp256k1 or Secp256r1
* @returns {string} The properly formatted public key
* @throws {Error} If the key type is invalid
*/
export declare const formatEbsiPublicKey: (args: {
key: IKey;
type: TKeyType;
}) => string;
export declare const ebsiGetIssuerMock: (args: {
environment?: EbsiEnvironment;
version?: EbsiApiVersion;
}) => string;
export declare const ebsiGetAuthorisationServer: (args: {
environment?: EbsiEnvironment;
version?: EbsiApiVersion;
}) => string;
export declare const ebsiGetRegistryAPIUrls: (args: {
environment?: EbsiEnvironment;
version?: EbsiApiVersion;
}) => EbsiDidRegistryAPIEndpoints;
export declare const determineWellknownEndpoint: ({ environment, version, type, system, mock }: WellknownOpts) => string;
export declare const ebsiSignAndSendTransaction: (args: {
rpcRequest: RpcMethodArgs;
previousTxResponse?: EbsiRPCResponse;
kid: string;
accessToken: string;
apiOpts?: ApiOpts;
}, context: IContext) => Promise<EbsiRPCResponse>;
export declare const ebsiGenerateOrUseKeyPair: (args: {
keyOpts?: IKeyOpts;
keyType: EbsiKeyType;
kms: string;
controllerKey?: boolean;
}, context: IAgentContext<IKeyManager>) => Promise<MinimalImportableKey>;
export declare const toMinimalImportableKey: (args: {
key?: IKeyOpts;
type: EbsiKeyType;
kms: string;
}) => Promise<MinimalImportableKey>;
export declare const assertedPurposes: (args: {
key?: IKeyOpts;
}) => EbsiPublicKeyPurpose[] | undefined;
export declare const setDefaultPurposes: (args: {
key?: IKeyOpts;
type: EbsiKeyType;
}) => EbsiPublicKeyPurpose[];
export declare const randomRpcId: () => number;
export declare const ebsiCreateDidOnLedger: (args: CreateEbsiDidParams, context: IRequiredContext) => Promise<CreateEbsiDidOnLedgerResult>;
//# sourceMappingURL=functions.d.ts.map