Shared details
(Android & iOS)
Methods details
Connect to the card
Android Signature iOS Signature | public void connect() throws SDKException public func connect() throws |
---|---|
Description | Power and connect to the card. This action:
|
Requirements | - |
Parameters | - |
Returns | Nothing |
Throws | SDKException if the operation fails |
Authenticate to the card
Android Signature iOS Signature | public void authenticate(String withPin) throws SDKException public func authenticate(withPin: String) throws |
---|---|
Description | Authenticate to the card with a passphrase (PIN) if the PIN is active in the CVM |
Requirements | - |
Parameters | String withPin: PIN to use – String, size exactly 4 characters |
Returns | Nothing |
Throws | SDKException if the operation fails
|
Change PIN
Android Signature iOS Signature | public void changePin(String newPin) throws SDKException public func changePin(newPin: String) throws |
---|---|
Description | Update the card PIN with the new pin |
Requirements | Connection with PIN required |
Parameters | String newPin : The new PIN to use – String, size exactly 4 characters |
Returns | Nothing |
Throws | SDKException if the operation fails |
Unlock PIN with PUK
Android Signature iOS Signature | public void unlockPin(String puk) throws SDKException public func unlockPin(puk: String) throws |
---|---|
Description | Unlock the PIN after too many wrong tries, with the PUK (PIN Unlock Key) |
Requirements | - |
Parameters | String puk : The current card PUK – size exactly 16 characters (8 bytes in hex format) |
Returns | Nothing |
Throws | SDKException if the operation fails |
Import user seed in the card
Android Signature iOS Signature | public void initializeSeed(byte[] seed) throws SDKException public func initializeSeed(seed: Data) throws |
---|---|
Description | Import a seed in the card |
Requirements | Card not initialized with a seed |
Parameters | Byte[] seed: BIP39 seed to import (16 – 64 bytes) |
Returns | Nothing |
Throws | SDKException if the operation fails |
Get card public key
Android Signature iOS Signature | public byte[] getPublicKey(String bipPath, Boolean withChainCode, Boolean compressKey) throws SDKException public func getPublicKey(bipPath: String, withChainCode: Bool, compressKey: Bool) throws -> Data |
---|---|
Description | Get card public key for the given BIP path (BIP32) |
Requirements | Connection with PIN required or biometry validated according to user rule |
Parameters |
|
Returns | Public key (bytes) |
Throws | SDKException if the operation fails |
Result sample:
Shell1Compressed key + chain code:2035A784662A4A20A65BF6AAB9AE98A6C068A81C52E4B032C0FB5400C706CFCCC5647FDACBD0F1097043B78C63C20C34EF4ED9A111D980047AD16282C7AE62361413Normal key + chain code:4045A784662A4A20A65BF6AAB9AE98A6C068A81C52E4B032C0FB5400C706CFCCC567F717885BE239DAADCE76B568958305183AD616FF74ED4DC219A74C26D35F83947FDACBD0F1097043B78C63C20C34EF4ED9A111D980047AD16282C7AE62361415Compressed key:6035A784662A4A20A65BF6AAB9AE98A6C068A81C52E4B032C0FB5400C706CFCCC567Normal key:8045A784662A4A20A65BF6AAB9AE98A6C068A81C52E4B032C0FB5400C706CFCCC567F717885BE239D AADCE76B568958305183AD616FF74ED4DC219A74C26D35F839
Sign transaction
Android Signature iOS Signature | public SignedData signTransaction(String bipPath, byte[] transactionHash) throws SDKException public func signTransaction (bipPath: String, transactionHash: Data) throws -> SignedData |
---|---|
Description | Perform a signature on the given transaction hash |
Requirements | Connection with PIN required or biometry validated according to user rule |
Parameters |
|
Returns | Returns SignedData object, this object contains signature data (r, s, v) |
Throws | SDKException if the operation fails |
Result sample:
R: 4D065CB5C367D2FFB3773E34F4415762F639DDCBA60AA78C8A29EFBA1F18FBAE S: 30A97E8DA7BF6A649DD95EE13B5078DFF790E5E9BA160B70099BCB52C4C704DE V: 01
Wipe card wallet
Android Signature iOS Signature | public void wipeWallet() throws SDKException public func wipeWallet() throws |
---|---|
Description | Wipe card data and lock the card |
Requirements | Connection with PIN required and biometry verified |
Parameters | - |
Returns | Nothing |
Throws | SDKException if the operation fails |
Get card status
Android Signature iOS Signature | public CardStatus getCardStatus() throws SDKException public func getCardStatus() throws -> CardStatus |
---|---|
Description | Get card information status:
|
Requirements | - |
Parameters | - |
Returns | Card status descriptor |
Throws | SDKException if the operation fails |
Update user authentication rule
Android Signature iOS Signature | public void updateUserAuthenticationRule(int userAuthenticationRule) throws SDKException public func updateUserAuthenticationRule(userAuthenticationRule : Int) throws |
---|---|
Description | Update the card authentication rule (biometry or/and PIN) to use by the card |
Requirements | Connection with pin required or biometry validated according to the current user rule |
Parameters | int userAuthenticationRule :
|
Returns | Nothing |
Throws | SDKException if the operation fails |
Error details
The SDK uses the class SDKException
to notify when unexpected behavior is obtained; this class has three attributes to describe the error:
| Code: This is the error code; see possible values in next table
| Card status code: This is the status code (SW) returned by the card (Optional)
| Message: This is the error message
Error code list:
Error code | Description |
---|---|
E001 | Connection error (Communication stopped or not started) |
E002 | Card not compatible |
E003 | Card error (Generic error when the card return an error, see card status code to have more details) |
E004 | Counter error / Authentication failed |
E005 | Timeout |
E100 | Internal error |
E101 | Unexpected response |
E200 | Wrong input |
E201 | Internal check failed |
E202 | Security check fail |
E205 | Not found item |
E206 | Canceled operation |
E207 | Data already exist |
E208 | Operation blocked |