📃
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
  • Constructor
  • isUnLock
  • lock
  • unLock
  • isExistKey
  • addKey
  • removeKey
  • getKeyIdList
  • getPublicKey
  • getSign
  • addClaim
  • getClaims
  • Filtering Condition
  • getClaims(filter)
  • removeClaim(int) - No indication for exception
  • removeClaim(VerifiableClaim)
  • removeClaims(filter)
  • getECIESEncryptBytes
  • getECIESDecryptBytes
  • readKeyFileHeader
  • deleteWalletFile - Insufficient
  • makeRequestVerifiableClaim
  • makeRequestVerifiableClaimCopy
  • makeProof

Was this helpful?

  1. SDK instruction guide
  2. Core SDK Guide
  3. Java Wallet

IWKeyManager

API - IWKeyManager

Constructor

public IWKeyManagerImpl(String keyFile_pathWithName) throws IWException

Description

  • please call the constructor by designating the name and path

parameter

Type

Name

Description

String

name

The file name of Wallet (file path included)

Throws

  • IWException

isUnLock

public boolean isUnLock()

Description

  • Check whether the Wallet status is unlocked or not

lock

public boolean lock()

Description

  • For the privacy data protection, change wallet to the Lock status

Return

  • boolean: true (Locked successfully)

unLock

public void unLock(String pwdOrAlias, OnUnLockListener listener) throws IWException

Description

  • Changing the status of the Wallet to unlock by using password

Parameter

Type

Name

Description

String

pwdOrAlias

Password

OnUnLockListener

listener

Callback

OnUnLockListener

  • onSuccess()

  • onFail(int errCode)

Type

Name

Description

int

errCode

Occuring error code

  • onCancel()

Throws

  • IWException

isExistKey

public boolean isExistKey(String keyId) throws IWException

Description

  • Use Key ID to check whether the corresponding key exists.

    Constraint: only works when it is on a unlock status

Parameter

Type

Name

Description

String

keyId

Key ID

Return

  • boolean: true (the corresponding key exists to the Key ID)

Throws

  • IWException

addKey

public void addKey(IWKey key) throws IWException

Description

  • Add Key

  • Key Manager operates only on the unlock status

Parameter

Type

Name

Description

IWKey

key

Public Key and Private Key to store

Throws

  • IWException

removeKey

public void removeKey(String keyId) throws IWException

Description

  • Use Key ID to remove the corresponding Key.

  • Key Manager operates only on the unlock status.

Parameter

Type

Name

Description

String

keyId

Key ID of the Key to be removed

Throws

  • IWException

getKeyIdList

public List<String> getKeyIdList() throws IWException

Description

  • Search the whole list of the Key ID that is stored.

Return

  • List< String > : List of Key ID

Throws

  • IWException

getPublicKey

public String getPublicKey(String keyId) throws IWException

Description

  • Use Key ID to search Public key.

Parameter

Type

Name

Description

String

keyId

Key ID of the Key to search

Return

  • String: Public Key - [Base58]

Throws

  • IWException

getSign

public byte[] getSign(String keyId, byte[] source) throws IWException

Description

  • Use Key ID to sign the source.

    Constraint: only works when it is on a unlock status

Parameter

Type

Name

Description

String

keyId

Key Id of the Key to be used for signing

byte[]

source

Source for signing

Return

byte[] : (Signature) - [byte array]

Throws

  • IWException

addClaim

public boolean addClaim(String claimJSON) throws IWException

Description

  • Add Claim(JSON)

    Constraint: only works when it is on a unlock status

Parameter

Type

Name

Description

String

claimJSONtp

Claim(JSON) to be stored

Return

  • boolean: true (Stored successfully)

Throws

  • IWException

getClaims

public List<VerifiableClaim> getClaims() throws IWException

Description

  • search the whole list of claims that are stored

Return

  • List< VerifiableClaim >: the whole list of claims that are stored

Throws

  • IWException

Filtering Condition

Filter condition has to obey below rules :
space must be included between object, condition, and value
It follows property's name

#object name condition
object must be connnected with dot(.)
like below

claim.id

#bool value action condition
== : equal value

#string object action condition
== : exactly same value
!= : without that value

#number value action condition
== : equal value
!= : not equal value
> : greater than the value
>= : greater than the value or equal
< : less than the value
<= : less than the value or equal


e.g.
"id == somewhat"

getClaims(filter)

 public List<VerifiableClaim> getClaims(String filter) throws IWException

Description

  • Get specific Claims with filtering Condition

Parameter

Type

Name

Description

String

filter

Condition for filtering

Return

  • List< VerifiableClaim > : Array of Claims

Throws

  • IWException

removeClaim(int) - No indication for exception

public void removeClaim(int index) throws IWException

Description

  • Remove claim by using Index.

    Constraint: Only works when it is on a unlock status

Parameter

Type

Name

Description

int

index

Claim's index

removeClaim(VerifiableClaim)

 public void removeClaim(VerifiableClaim claim) throws IWException

Description

  • Search then remove a claim from the list that matches with the inputted claim

Parameter

Type

Name

Description

VerifiableClaim

claim

Claim object

Throws

  • IWException

removeClaims(filter)

 public void removeClaims(String filter) throws IWException

Description

  • Use filtering functions to remove a searchable claim

Parameter

Type

Name

Description

String

filter

filtering condition

Throws

  • IWException

getECIESEncryptBytes

 public byte[] getECIESEncryptBytes(String keyId, byte[] nonce, String publicKey, byte[] source, AESType aesType) throws IWException

Description

  • Get encrypted data via the Elliptic Curve Integrated Encryption Scheme using AES Encryption

    Constraint: Only works when it is on a unlock status

Parameter

Type

Name

Description

String

keyId

Key ID

byte[]

nonce

random value

String

publicKey

public key(Base58 encoded)

byte[]

source

plain text to encrypt

AESType

aesType

AES128 or AES256

Return

  • byte[]: encrypted data

Throws

  • IWException

getECIESDecryptBytes

 public byte[] getECIESDecryptBytes(String keyId, byte[] nonce, String publicKey, byte[] source, AESType aesType) throws IWException

Description

  • Get decrypted data via Elliptic Curve Integrated Decryption Scheme using AES Decryption

    Key Manager status must be at an unlocked state.

Parameter

Type

Name

Description

String

keyId

Key ID

byte[]

nonce

random value

String

publicKey

public key(Base58 encoded)

byte[]

source

ciphertext

AESType

aesType

AES128 or AES256

Return

  • byte[] : Decrypted Data for Success

Throws

  • IWException

readKeyFileHeader

public String readKeyFileHeader() throws IWException

Description

  • Search Wallet's Header with the JSON format.

Return

  • String: Wallet's Header (JSON)

Throws

  • IWException

deleteWalletFile - Insufficient

public void deleteWalletFile()

Description

  • Remove the Wallet file. (if exists)

makeRequestVerifiableClaim

public String makeRequestVerifiableClaim(String dId, Privacy privacy)

Description

  • create a request with full-text(JSON) for issuing the Verifiable Claim

Parameter

Type

Name

Description

String

did

Signer's DID

Privacy

privacy

Privacy Object of the signer

Return

  • String: request with full-text(JSON) for issuing the Verifiable Claim

Next Step

makeProof

makeRequestVerifiableClaimCopy

public String makeRequestVerifiableClaimCopy(String verifiableClaimJSON, Privacy privacy, ServiceProviderProfile spProfile, String expires) throws IWException

Description

  • Create the Verifiable Claim Copy(JSON)

Parameter

Type

Name

Description

String

verifiableClaimJSON

Verifiable Claim(JSON)

Privacy

privacy

Signer's Privacy Object

ServiceProviderProfile

spProfile

Service Provider Object

String

expires

expiry date

Return

  • String: Verifiable Claim Copy JSON String

Throws

  • IWException

Next Step

makeProof

makeProof

 public String makeProof(String verifiableClaimJSON, String signKeyId, byte[] nonce, IWKeyManager keyManager) throws IWException

Description

  • Create proof for the submission.

Parameter

Type

Name

Description

String

verifiableClaimJSON

Verifiable Claim(JSON)

String

signKeyId

Key ID of the Key for signature

byte[]

nonce

random value

IWKeyManager

keyManager

the instance of the IWKeyManager interface

Return

  • String: JSON String consisting of Verifiable Ciam with Proof

Throws

  • IWException

PreviousJava WalletNextIWDIDManager

Last updated 4 years ago

Was this helpful?