import { IdenityRegistry } from '@tangleid/did' ; import { signRsaSignature , verifyRsaSignature } from '@tangleid/jsonld' ; import { DocumentLoader } from './jsonld/documentLoader' ; import { TangleProvider , Seed , Did , PublicKeyMeta , PrivateKeyPem , PublicKeyPem } from '../../types' ; export type Settings = { provider ? : TangleProvider ; } ; export class CoreAPI { private registry : IdenityRegistry ; private documentLoader : DocumentLoader ; constructor ( settings = { } ) { this . registry = new IdenityRegistry ( settings . provider ) ; this . documentLoader = new DocumentLoader ( this . registry ) ; } memberof function param { string } seed param { string [ ] } publicKeys returns { Promise < object > } public async registerIdentifier ( seed , publicKeys = [ ] ) { const didDocument = await this . registry . publish ( seed , publicKeys ) ; return didDocument ; } memberof function param { string } did returns { Promise < object > } Promise object represents the
     *    https .
      public async resolveIdentifier ( did ) { const didDocument = await this . registry . fetch ( did ) ; return didDocument ; } memberof function param { object } document param { PublicKeyMeta } publicKey param { string } privateKeyPem returns { Promise < object > } public async signRsaSignature ( document , publicKey , privateKeyPem ) { const documentSigned = await signRsaSignature ( document , publicKey , privateKeyPem , { documentLoader : this . documentLoader . loader ( ) } ) ; return documentSigned ; } memberof function param { object } document returns { Promise < boolean > } public async verifyRsaSignature ( document ) { const verified = await verifyRsaSignature ( document , { documentLoader : this . documentLoader . loader ( ) } ) ; return verified ; } }