📃
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
  • Issuer API
  • KeyManager Unlock
  • Read DID Document
  • BlockChain node settings
  • VC Issuing API

Was this helpful?

  1. Server system construction
  2. Building the Issuer system

Issuer server guide(JAVA)

This is the Issuer SDK (Java) server guide document.

Issuer API

KeyManager Unlock

The private key is readable through IWKeyManager Class.

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

DID document can be read through the IWDIDFile class.

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

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

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

BlockChain node settings

BlockChain node settings can be set through the ServerInfo class.

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

VC Issuing API

VC issuance consists of 2 steps.

  • vcInit: Initial settings of the VC issuance.

    Depending on the issuance, if there is no token transaction by the user, vcReg will initiate internally.

  • vcReg: Register the created VC to the BlockChain

VC Init

  • VcInitParam Class

    • ServerInfo - BlockChain node server information

    • IWKeyManager - private key Wallet management

    • mainKeyId - Stored KeyID in the KeyManager for signing

    • vcRequestJson - VC creation request string(JSON)

    • issuerDidFile - Issuer DID file path

    • vcTypeCode - VC TYPE Code

//vcRequestJson sample
{
  "claim": {
    "id": "did:omn:[account]",
    "privacy": {
      "unprotected": [
        //claim datas
      ]
    }
  },
  "proof": {
    "created": "[date]",
    "creator": "did:omn:[account]",
    "nonce": "[nonce]",
    "signatureValue": "[signatureValut]",
    "type": "[type]"
  }
}
  • IssuerApi.vcInit Class - Init Api

    • vcInit(VcInitParam vcInitParam)

  • VcResult Class - Result Class

    • issueCost - VC issuance cost(optional)

    • status - status information (required)

      • 0 = VC creation incomplete

      • 1 = VC creation completed

    • vcComplete - Completed VC(required)

    • vcDefCode - VC Code(optional)

VcInitParam vcInitParam = new VcInitParam(serverInfo,
                                         keyManager,
                                         "key1",
                                         vcRequestJson,
                                         issuerDidDocuemntPath,
                                         configBean.getVcAssertionId());
        

VcResult vcResult = IssuerApi.vcInit(vcInitParam);
if(vcResult.getStatus().equals("0")) {
			//VC is created but yet has not been registered on the BlockChain(The user MUST pay a token to register)
			VerifiableClaim vcComplete = vcResult.getVcCompelete();
			String vcCompleteJson = vcComplete.toJson();
			resultVc.setClaimBase64(GDPBase64.encodeUrlString(vcCompleteJson.getBytes()));

}else{
			//VC creation completed and registered on the BlockChain
			VerifiableClaim vcComplete = vcResult.getVcCompelete();
			String vcCompleteJson = vcComplete.toJson();
			resultVc.setClaimBase64(GDPBase64.encodeUrlString(vcCompleteJson.getBytes()));
}

return vcResult;

VC Reg

An API for the VC to register finally on the Blockchain.

  • VcRegParam Class - Reg Data

    • ServerInfo - BlockChain Node server information

    • keyManager - Private key Wallet management

    • mainKeyId - Stored KeyID in the KeyManager for signing

    • vcInitResultJson - VC Init result data (Json)

    • issuerDidFile - File path Issuer DID

    • txId - Token Transfer TX ID

vcInitResultJson is a JSON string converted data of vcResult received through vcInit.

  • IssuerApi.vcReg Class - Init API

    • vcReg(VcRegParam vcRegParam)

  • VcResult Class - Result Class

    • issueCost - VC issuing cost (optional)

    • status - status info (required)

      • 0 = VC creation incomplete

      • 1 = VC creation completed

    • vcComplete - Completed VC (essensial)

    • vcDefCode - VC code (optional)

VcRegParam vcRegParam = new VcRegParam(serverInfo, 
														keyManager, 
														"key1",
														vcResultJson,
														issuerDidDocuemntPath, 
														issueRegParam.getTxId(),
														issueRegParam.getBlockNum(),
														issueRegParam.getUserDid()
														);

VcResult vcResult = IssuerApi.vcReg(vcRegParam);
VerifiableClaim vcComplete = vcResult.getVcCompelete();
String vcCompleteJson = vcComplete.toJson();
PreviousBuilding the Issuer systemNextBuilding the SP system

Last updated 4 years ago

Was this helpful?