Skip to main content

RevocationBitmap

@iota/identity-wasm API documentation


Class: RevocationBitmap

A compressed bitmap for managing credential revocation.

Constructors​

new RevocationBitmap()​

new RevocationBitmap(): RevocationBitmap

Creates a new RevocationBitmap instance.

Returns​

RevocationBitmap

Methods​

toJSON()​

toJSON(): Object

  • Return copy of self without private attributes.

Returns​

Object


toString()​

toString(): string

Return stringified version of self.

Returns​

string


type()​

static type(): string

The name of the service type.

Returns​

string


isRevoked()​

isRevoked(index): boolean

Returns true if the credential at the given index is revoked.

Parameters​

index​

number

Returns​

boolean


revoke()​

revoke(index): boolean

Mark the given index as revoked.

Returns true if the index was absent from the set.

Parameters​

index​

number

Returns​

boolean


unrevoke()​

unrevoke(index): boolean

Mark the index as not revoked.

Returns true if the index was present in the set.

Parameters​

index​

number

Returns​

boolean


len()​

len(): number

Returns the number of revoked credentials.

Returns​

number


toService()​

toService(serviceId): Service

Return a Service with:

  • the service's id set to serviceId,
  • of type RevocationBitmap2022,
  • and with the bitmap embedded in a data url in the service's endpoint.

Parameters​

serviceId​

DIDUrl

Returns​

Service


fromEndpoint()​

static fromEndpoint(service): RevocationBitmap

Try to construct a RevocationBitmap from a service if it is a valid Revocation Bitmap Service.

Parameters​

service​

Service

Returns​

RevocationBitmap