createIdentityDescriptor function

IdentityDescriptor createIdentityDescriptor(
  1. Identity identity
)

Implementation

IdentityDescriptor createIdentityDescriptor(
  Identity identity,
) {
  final identityIndicator = identity is SignIdentity
      ? {
          "type": 'PublicKeyIdentity',
          "publicKey": identity.getPublicKey().toDer().toHex(include0x: false)
        }
      : {"type": 'AnonymousIdentity'};
  return IdentityDescriptor.fromJson(identityIndicator);
}