getNextCredentialDID method

Future<String> getNextCredentialDID([
  1. KeyType keyType = KeyType.secp256k1,
  2. bool isDidKey = false
])

Returns a new DID a credential could be issued for.

Implementation

Future<String> getNextCredentialDID(
    [KeyType keyType = KeyType.secp256k1, bool isDidKey = false]) async {
  if (keyType == KeyType.secp256k1) {
    return _getNextCredentialDidEthr(isDidKey);
  } else if (keyType == KeyType.ed25519) {
    return _getNextCredentialDIDWithEdKey();
  } else if (keyType == KeyType.p384 ||
      keyType == KeyType.p256 ||
      keyType == KeyType.p521) {
    return _generatePdid(keyType, 'lastCredentialDidP');
  } else {
    throw Exception('Unsupported Credential KeyType `$keyType`');
  }
}