API Reference

Index

NewOntLoginSdk

Creates an OntLoginSdk instance.

Parameters

SDKConfig

SDK configuration

public class SDKConfig {
	String[] chain;                        // Supported chain, e.g."ONT","ETH","BSC"
    String[] alg;                        // Signature scheme such as "ES256","Ed25519"
    ServerInfo serverInfo;               // Server configuration info, see details below
    Map<Integer, VCFilter[]> vcFilters;  // VCFilter info for authentication/authorization, see details below
}

Map<string,DidProcessor>

DID processor map

@Override

public String genRandomNonceFunc(Integer action)

Function to generate nonce

@Override

public Integer getActionByNonce(String nonce)

Gets action by nonce

Returns

OntLoginSdk

GenerateChallenge

Generates the challenge.

Parameters

Returns

ServerHello

ValidateClientResponse

Validates the response from the client.

Parameters

Returns

Field

Description

null

Validation successful

Validation Process:

  1. Verify the validity of parameters

  2. Verify if the nonce is the same as the one generated by the server

  3. verify the signature

  4. Verify the validity of VP and VC

  5. Check if the provided VC meets the requirement

GetCredentialJson

Gets JSON string of VC from VP.

Parameters

Parameter

Description

chain

Chain name

presentation

VP string

Returns

Field

Description

[]string

JSON string of VC

Last updated