IWKeyManager
API - IWKeyManager
Constructor
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
Description
Check whether the Wallet status is unlocked or not
lock
Description
For the privacy data protection, change wallet to the Lock status
Return
boolean: true (Locked successfully)
unLock
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
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
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
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
Description
Search the whole list of the Key ID that is stored.
Return
List< String > : List of Key ID
Throws
IWException
getPublicKey
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
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
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
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
getClaims(filter)
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
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)
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)
Description
Use filtering functions to remove a searchable claim
Parameter
Type
Name
Description
String
filter
filtering condition
Throws
IWException
getECIESEncryptBytes
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
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
Description
Search Wallet's Header with the JSON format.
Return
String: Wallet's Header (JSON)
Throws
IWException
deleteWalletFile - Insufficient
Description
Remove the Wallet file. (if exists)
makeRequestVerifiableClaim
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
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
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
Last updated