📃
OmniOne Developer Site
  • Introduction
  • Manager console guide
    • To begin with...
      • Wallet Settings
      • Select an Account
      • The Issuer/SP account creation
      • Issue access token for the OmniOne Agent
    • Issuer Console
      • Claim
      • VC Type
      • VC Format
      • Issue the VC Information
      • My request list
    • SP Console
      • Service List
      • Token Transaction History
      • My service request
  • Server system construction
    • To begin with...
      • Server Wallet creation and Key settings
      • Collect the Issuer and SP's DID
      • application.properties settings
    • Server default environment configuration per IDE
      • Spring Tool Suite 4
      • IntelliJ IDEA
    • Building the Issuer system
      • Issuer server guide(JAVA)
    • Building the SP system
      • SP server guide (JAVA)
  • Checking Blockchain data
    • Check Agent API
      • bp
      • Committee
      • DID
      • executor
      • key
      • pDID
      • player
      • policy
      • txinfo
      • txissue
      • vc
      • version
      • response codes
  • SDK instruction guide
    • Core SDK Guide
      • Java Wallet
        • IWKeyManager
        • IWDIDManager
        • IWRecoveryManager
        • ZkpException
        • IWException
      • iOS Wallet
        • IWKeyManager
        • IWDidManager
        • IWClaimManager
        • IWRecoveryManager
        • IWErrorManager
        • Enum
    • Server SDK Guide
      • Java
        • ServerInfo
        • IssuerApi
        • SpApi
        • VcResult
        • VcInitParam
        • VCRegParam
        • VcVerifyParam
        • SpProfileParam
    • Omni App Link SDK
      • Server
      • Android
      • IOS
  • Node creation
    • Full Node creation
      • Full Node by using Docker
        • Docker Installation
        • Building Full Node
        • Full Node settings
      • Installation type Full Node
        • Full Node installation
    • BP Node creation
      • BP Node by using Docker
        • Docker Installation
        • Building BP Node
        • BP Node settings
          • keosd/BP Node executing simultaneously
      • Installation type BP
        • Node Installation
        • Executing Node
        • Node settings
        • BP Vote
Powered by GitBook
On this page
  • SP API guide document
  • Unlock KeyManager
  • Read DID document
  • BlockChain node settings
  • Agent Server settings
  • Send Callback confirmation URL to mobile app
  • VC verification API
  • SP profile
  • VC Verification

Was this helpful?

  1. Server system construction
  2. Building the SP system

SP server guide (JAVA)

This is the SP SDK(Java) Server Application guide document.

SP API guide document

Unlock KeyManager

Use the KeyManager class to get the secrete key.

String keyManagerFile = "key.wallet";
String keyManagerPass = "keywalletPassword";

IWKeyManager keyManager = new IWKeyManager(keyManagerFile, keyManagerPass);
keyManager.unLock(keyManagerPass, new OnUnLockListener() {
    @Override
    public void onSuccess() {
        System.out.println("KeyManager Unlock onSuccess");
    }
    
    @Override
    public void onFail(int errCode) {
        System.out.println("KeyManager Unlock onFail:" + errCode);
    }
    
    @Override
    public void onCancel() {
         System.out.println("KeyManager Unlock onCancel");       
    }
});

Read DID document

SP DID document can get it through the IWDID File class.

Use getData() function to transfer to the Jason string.

String issuerDidFile = "sp.did";
IWDIDFile iwdidFile = new IWDIDFile(issuerDidFile);
String didDocJson = iwdidFile.getData();

System.out.println("didDocJson:" + didDocJson);  

BlockChain node settings

The RPC address of the blockchain node can be set.

String blockChainNodeUrl = "https://testnet.omnione.net:8889";
ServerInfo serverInfo = new ServerInfo(blockChainNodeUrl);

Agent Server settings

The RPC address of the Agent Server INFO can be set.

String agentUrl = "https://testnet.omnione.net";
ServerInfo agentServerInfo = new ServerInfo(agentUrl);

Send Callback confirmation URL to mobile app

  • callBackUrl: URL to VC 검증 restApi

  • queryParameter: Key(txid), value(Unique key)

  • PC web : create QR code image

  • mobile web : send URL Scheme

//qr code data source sample
{
  "spProfileUrl": "http://[IP address]:8080/omniissuer/sp/spProfile?txid=GAuw...pguh",
  "type": "VC",
  "vcLevel": "0"
}

//url scheme sample
omnione://authentication?spurl=http://[IP주소]:8080/omniissuer/shop/spProfileSt?txid=GAuw...pguh

VC verification API

To request the validity verification regarding the mobile app, it should be requested by the JSON format of SpProfile type. SpProfile includes the submit URL(CallBackUrl) of the VC copy.

  • spVerify: VC information copay verification API

SP profile

  • Profile

    • callBackUrl : URL for submitting the VC copy

    • nonce : Random value (txid)

    • spName : SP name

  • SpProfileParam class : SpProfile data

    • serverInfo : Blockchain node server URL

    • keyManager : Private key (secrete key) Wallet manager

    • mainKeyId : The stored key on the KeyManager for signing.

    • serviceCode : SP service code(The registered information on the SP Console)

    • profile : Profile object

    • spDid : SP's DID ID

  • SpApi.makeSpProfile

    • makeSpProfile (SpProfileParam spProfileParam)

  • Return String

    • spProfileJson : SP profile JSON String

String callBackUrl = "http://sp.com/verify";
String nonce = "random value";
String spDid = iwdidFile.getData().getId();

Profile profile = new Profile();
profile.setCallBackUrl(callBackUrl);
profile.setSpName("Pay");
profile.setNonce(nonce);

SpProfileParam spProfileParam = new SpProfileParam(
    serverInfo, 
    keyManager, 
    "key1", 
    serviceCode, 
    profile, 
    spDid);

String spProfileJson = SpApi.makeSpProfile(spProfileParam);

VC Verification

The API for final registration for VC on BlockChain

  • VC CallBack JSON Structure

    • vcEncHex - Encrypted VC copy information

    • vcId - VC ID

    • sessionId - Same value as the SpProfile nonce value

    • userDID - The user's DID ID

  • VcVerifyParam Class - Registeration data

    • serverInfo -Blockchain node server URL URL

    • agentServerInfo- Agent server URL

    • keyManager - private key (Secreate key) Wallet manager

    • mainKeyId - Stored key on the KeyManager for signing

    • vcEncHex - Encrypted VC copy information

    • vcId - VC ID

    • sessionId - Same value as the SpProfile nonce value

    • userDID - The user's DID ID

    • didDocuemntPath - SP DID document file path

  • SpApi.spVerify Class - reset API

    • spVerify(vcVerifyParam)

  • VcResult class - result class

    • status - Status information

      • 0 = VC creation incomplete

      • 1 = VC creation completed

    • vcComplete - Completed VC object

String vcEncHex = "";
String vcId = "";
String sessionId = "";
String userDid = "";

VcVerifyParam vcVerifyParam = new VcVerifyParam(
    serverInfo, 
    agentServerInfo, 
    keyManager, 
    "key1",
    vcEncHex, 
    vcId, 
    sessionId, 
    userDID, 
    didDocuemntPath);

VcResult vcResult = SpApi.spVerify(vcVerifyParam);
VerifiableClaim vcComplete = vcResult.getVcComplete();
String vcCompleteJson = vcComplete.toJson();
PreviousBuilding the SP systemNextCheck Agent API

Last updated 4 years ago

Was this helpful?

: creates the entered data and SpProfile JSON

makeSpProfile