Shared details
(Android & iOS)
 

Methods details 

Connect to the card 

Android Signature

iOS Signature
public void connect() throws SDKException

public func connect() throws
DescriptionPower and connect to the card. This action:

  • Powers the card,
  • Selects the B.Chain applet,
  • Initialize the secure channel.
Requirements-
Parameters-
ReturnsNothing
ThrowsSDKException 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
DescriptionAuthenticate to the card with a passphrase (PIN) if the PIN is active in the CVM
Requirements-
ParametersString withPin: PIN to use – String, size exactly 4 characters
ReturnsNothing
ThrowsSDKException if the operation fails

  • E208 : Card blocked
  • E004 : Wrong passphrase

Change PIN 

Android Signature

iOS Signature
public void changePin(String newPin) throws SDKException

public func changePin(newPin: String) throws
DescriptionUpdate the card PIN with the new pin
RequirementsConnection with PIN required
ParametersString newPin : The new PIN to use – String, size exactly 4 characters
ReturnsNothing
ThrowsSDKException 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
DescriptionUnlock the PIN after too many wrong tries, with the PUK (PIN Unlock Key)
Requirements-
ParametersString puk : The current card PUK – size exactly 16 characters (8 bytes in hex format)
ReturnsNothing
ThrowsSDKException 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
DescriptionImport a seed in the card
RequirementsCard not initialized with a seed
ParametersByte[] seed: BIP39 seed to import (16 – 64 bytes)
ReturnsNothing
ThrowsSDKException 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
DescriptionGet card public key for the given BIP path (BIP32)
RequirementsConnection with PIN required or biometry validated according to user rule
Parameters
  • String bipPath: Bip path for the public key – format BIP32 (m/0’/0),
  • Boolean withChainCode: enable or not the chain code in return data,
  • Boolean compressKey: enable or not the key compression in return data.
ReturnsPublic key (bytes)
ThrowsSDKException if the operation fails

Result sample:

Shell
1Compressed key + chain code:
2035A784662A4A20A65BF6AAB9AE98A6C068A81C52E4B032C0FB5400C706CFCCC5647FDACBD0F1097043B78C63C20C34EF4ED9A111D980047AD16282C7AE6236141
3Normal key + chain code:
4045A784662A4A20A65BF6AAB9AE98A6C068A81C52E4B032C0FB5400C706CFCCC567F717885BE239DAADCE76B568958305183AD616FF74ED4DC219A74C26D35F83947FDACBD0F1097043B78C63C20C34EF4ED9A111D980047AD16282C7AE6236141
5Compressed key:
6035A784662A4A20A65BF6AAB9AE98A6C068A81C52E4B032C0FB5400C706CFCCC56
7Normal 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
DescriptionPerform a signature on the given transaction hash
RequirementsConnection with PIN required or biometry validated according to user rule
Parameters
  • String bipPath: Bip path to use - format BIP32 (m/0’/0),
  • Byte[] transactionHash: Data to sign.
ReturnsReturns SignedData object, this object contains signature data (r, s, v)
ThrowsSDKException 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
DescriptionWipe card data and lock the card
RequirementsConnection with PIN required and biometry verified
Parameters-
ReturnsNothing
ThrowsSDKException if the operation fails

Get card status 

Android Signature

iOS Signature
public CardStatus getCardStatus() throws SDKException

public func getCardStatus() throws -> CardStatus
DescriptionGet card information status:

  • Card identifier,
  • Card state – 01 Perso phase, 02 PRE USE phase, 03 USE phase,
  • PIN try counter (PTC),
  • PIN try limit (PTL),
  • PUK try counter,
  • PUK try limit,
  • Biometry try counter (BTC),
  • Biometry try limit (BTL),
  • User authentication role (CVM) – 01 PIN required, 02 Biometry required, 03 PIN and biometry required,
  • Enrolled finger count.
Requirements-
Parameters-
ReturnsCard status descriptor
ThrowsSDKException 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
DescriptionUpdate the card authentication rule (biometry or/and PIN) to use by the card
RequirementsConnection with pin required or biometry validated according to the current user rule
Parametersint userAuthenticationRule:

  • 1 or CardStatus.CVM_PIN_REQUIRED: PIN required,
  • 2 or CardStatus.CVM_BIO_REQUIRED: Biometry required,
  • 3 or CardStatus.CVM_PIN_AND_BIO_REQUIRED: PIN and biometry required.
ReturnsNothing
ThrowsSDKException 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
E001Connection error (Communication stopped or not started)
E002Card not compatible
E003Card error (Generic error when the card return an error, see card status code to have more details)
E004Counter error / Authentication failed
E005Timeout
E100Internal error
E101Unexpected response
E200Wrong input
E201Internal check failed
E202Security check fail
E205Not found item
E206Canceled operation
E207Data already exist
E208Operation blocked