anon-identity
Version:
Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure
78 lines • 2.73 kB
TypeScript
import { RevocationList, KeyPair } from '../types';
import { IStorageProvider } from '../storage';
/**
* Mock revocation registry - in production this would be a distributed ledger or database
*/
declare class MockRevocationRegistry {
private static registry;
private static readonly BASE_URL;
static publish(issuerDID: string, revocationList: RevocationList): string;
static fetch(issuerDID: string): Promise<RevocationList | null>;
static fetchByUrl(url: string): Promise<RevocationList | null>;
static clear(): void;
}
export declare class RevocationService {
private keyPair;
private issuerDID;
private storageProvider;
constructor(keyPair: KeyPair, issuerDID: string, storageProvider?: IStorageProvider);
/**
* Revoke a credential by adding its ID to the revocation list
*/
revokeCredential(credentialId: string): Promise<void>;
/**
* Unrevoke a credential by removing its ID from the revocation list
*/
unrevokeCredential(credentialId: string): Promise<void>;
/**
* Check if a credential is revoked
*/
isRevoked(credentialId: string): Promise<boolean>;
/**
* Get all revoked credential IDs
*/
getRevokedCredentials(): Promise<string[]>;
/**
* Update the revocation list in storage
*/
private updateRevocationList;
/**
* Create a signature for the revocation list
*/
private createRevocationSignature;
/**
* Create and sign a revocation list (for backward compatibility)
*/
createRevocationList(): Promise<RevocationList>;
/**
* Sign a revocation list
*/
private signRevocationList;
/**
* Publish the revocation list to the mock registry
*/
publishRevocationList(): Promise<string>;
/**
* Verify a revocation list signature
*/
static verifyRevocationList(revocationList: RevocationList, issuerPublicKey: Uint8Array): Promise<boolean>;
/**
* Fetch a revocation list from a URL (using mock registry)
*/
static fetchRevocationList(url: string): Promise<RevocationList | null>;
/**
* Fetch a revocation list by issuer DID (using mock registry)
*/
static fetchRevocationListByIssuer(issuerDID: string): Promise<RevocationList | null>;
/**
* Clear the mock registry (for testing)
*/
static clearRegistry(): void;
revokeCredentialSync(credentialId: string): void;
unrevokeCredentialSync(credentialId: string): void;
isRevokedSync(credentialId: string): boolean;
getRevokedCredentialsSync(): string[];
setStorageProvider(provider: IStorageProvider): void;
}
export { MockRevocationRegistry };
//# sourceMappingURL=revocation-service.d.ts.map