Dastine
Dastine Class Reference

Public Member Functions

string GetVersion (void)
 
int SelectCertificateFromWindowsByUI (string issuerDn, string keyUsages)
 
int SelectCertificateFromWindowsBySubject (string subject, string issuerDn, string keyUsages)
 
int SelectCertificateFromTokenByUI (string issuerDn, string keyUsages)
 
int SelectCertificateFromTokenBySubject (LPCWSTR subject, string issuerDn, string keyUsages)
 
int SelectCertificateFromFileByUI (string issuerDn, string keyUsages, string p12, string password)
 
int SelectCertificateFromFileBySubject (string subject, string issuerDn, string keyUsages, string p12, string password)
 
int SelectCertificateByThumbprint (string thumbprint)
 
string FindCertificate (string issuerDn, string keyUsages)
 
string GetSelectedCertificate (void)
 
string GetProviderName (void)
 
string Sign (string data, string hashAlg)
 
string CmsSign (string message, bool attachData, string hashAlg)
 
string CmsSignWithAttributes (string message, string AuthenticatedAttributes, string UnAuthenticatedAttributes)
 
string CmsDecrypt (string cipher)
 
string Decrypt (string cipher)
 
string Base64ToUnicode (string base64Str)
 
string UnicodeToBase64 (string unicodeStr)
 
string ListTokens (void)
 
string GenerateKeyPairAndCertificateRequest (string subjectDN, string keyLength, string tokenName)
 
String GenerateKeyPairAndCertificateRequestWithSANS (String subjectDN, String keyLength, String tokenName, string UPN, string RFC822_NAME, string DNS_NAME, string URI, string DIRECTORY_NAME, string IP_ADDRESS, string REGISTERED_ID)
 
string GenerateKeyPairAndCertificateRequestOnSelectedCertificate (string subjectDN, string keyLength, string tokenName)
 
string GenerateCertificateRequestBySelectedCertificate (void)
 
int ImportIssuedCertificate (string certificate)
 
int ImportIssuedCertificateOnSelectedCertificate (string certificate)
 
int ImportCertificateFromFileToToken (string p12, string password, string tokenName, string keyContainer)
 
int RemoveGeneratedKeyPair (void)
 
int RemoveSelectedCertificate (void)
 
int SetTokenRemoveEvent (void)
 
int SetTokenInsertEvent (void)
 
int SetAdminKey (string adminKey, string tokenName)
 
int SetPIN (string pin, string tokenName)
 
int ChangePIN (string tokenName)
 
int UnblockPIN (string tokenName)
 
int ReadSignatureImage (void)
 
int ReadFaceImage (void)
 
int ReadFingerprintImage (void)
 
string ReadValidationData (void)
 
string ReadPrintedData (void)
 
string ReadExtendedPrintedData (void)
 
string ReadSerialNumber (void)
 
string ReadIDinCardsSerialNumber (void)
 
string ReadCustomField (int index)
 
int Reset (void)
 
int CheckUpdate ()
 
int InstallUpdate ()
 
int CaptureFingerPrintScanner (string scannerName)
 
string GetFingerPrintScannerSupportedDevices (void)
 
int SetIDinCard (string serialNumber)
 
int SetIDinCardIndexForIssuance (string serialNumber)
 
string NIDGetFingerIndex (string smartCardReaderName)
 
string NIDAuthenticateByPIN (string smartCardReaderName)
 
string NIDAuthenticateByFingerUI (string smartCardReaderName)
 
string NIDAuthenticateByFinger (string smartCardReaderName, string index, string imageData, string imageWidth, string imageHeight, string imageResolution)
 
string NIDSign (string smartCardReaderName, string data)
 
string NIDChangePIN (string smartCardReaderName, string pinType, string oldPin, string newPin)
 
string NIDUnblockPIN (string smartCardReaderName, string pinType)
 
string SetPINGuide (string guideText)
 
string NIDSetDSAuthToken (string authenticationToken)
 
string DastineInitialize ()
 
string DastineSetPort (string Port, string SSLPort)
 

Member Function Documentation

◆ Base64ToUnicode()

string Dastine::Base64ToUnicode ( string  base64Str)

Converts a base64 string to Unicode.
Supported by
           Android and Windows.

Parameters
base64StrInput base64 string
Returns
Converted Unicode string if succeeded
Or an ErrorCode

◆ CaptureFingerPrintScanner()

int Dastine::CaptureFingerPrintScanner ( string  scannerName)

Capture image from scanner by specific fingerprint scanner device.
Supported by
           Windows.

Parameters
scannerNameinput the desirable scanner device name to capture image. Available scanners are "HongdaS580" and "Suprema".
Returns
The values of "imgWidth", "imgHeight", "imgResolution" and "imgValue" are returned as a JSON string.
Or an ErrorCode

◆ ChangePIN()

int Dastine::ChangePIN ( string  tokenName)

Changes an IDin's PIN.
Supported by
           Android and Windows.

Parameters
tokenNameThe name of CSP that it's PIN is going to be changed. This name can be obtained using ListTokens() function.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ CheckUpdate()

int Dastine::CheckUpdate ( )

Check server for update
Supported by
           Windows.

Parameters
void
Returns
110   E_DASTINE_IS_UP_TO_DATE
Or an ErrorCode

◆ CmsDecrypt()

string Dastine::CmsDecrypt ( string  cipher)

CmsDecrypts the input cipher. The input cipher is in CMS format described in PKCS7 standard.
Supported by
           Android and Windows.

Parameters
cipherInput cipher in base64 format which is desired to be cmsdecrypted.
Returns
CmsDecrypted data if succeeded
Or an ErrorCode

◆ CmsSign()

string Dastine::CmsSign ( string  message,
bool  attachData,
string  hashAlg 
)

CMSSigns the input message using the selected certificate. The returned cipher is in CMS format described in PKCS7 standard. A certificate must have been selected before calling this function.
Supported by
           Android and Windows.

Parameters
messageInput message in base64 format which is desired to be cmssigned.
attachDataA boolean that determines wethere the message is attached to the CMS or not.
hashAlgHash algorithm used in signing process.
Possible values are:
         SHA1, SHA256, SHA384, SHA512.
Returns
CMSSigned data in base64 format if succeeded
Or an ErrorCode

◆ CmsSignWithAttributes()

string Dastine::CmsSignWithAttributes ( string  message,
string  AuthenticatedAttributes,
string  UnAuthenticatedAttributes 
)

CmsSignWithAttributes signs the input message with Authenticated and UnAuthenticated Attributes using the selected certificate. The returned cipher is in CMS format described in PKCS7 standard. A certificate must have been selected before calling this function. This function can be called more than one time to perform multiple signatures on a CMS.
Supported by
           Windows.

Parameters
messageInput message in base64 format which is desired to be cmssigned.
AuthenticatedAttributesAn attribute to be signed as defined in PKCS#9 standard. Sample usage: Time=2017-04-02 02:15:36
UnAuthenticatedAttributesAn unsigned attribute as defined in PKCS#9 standard.
Returns
CMSSigned data in base64 format if succeeded
Or an ErrorCode

◆ DastineInitialize()

string Dastine::DastineInitialize ( )

If Dastine is not initialized, this function initialize it and try to connecting sockets.
Supported by
           Windows.

Returns
00   SUCCESSFUL
Or DASTINE_IS_OPENING
Or DASTINE_IS_OPEN

◆ DastineSetPort()

string Dastine::DastineSetPort ( string  Port,
string  SSLPort 
)

Set dedicated ports for connecting to Dastine local server. This function must call before initializing Dastine.
Supported by
           Windows.

Parameters
Portis a WS port for connecting to Dastine local server.
SSLPortis a WSS port for connecting to Dastine local server.
Returns
00   SUCCESSFUL
Or DASTINE_IS_OPENING
Or DASTINE_IS_OPEN

◆ Decrypt()

string Dastine::Decrypt ( string  cipher)

Decrypts the input cipher. The input cipher is in PKCS1 format described in PKCS1 standard. A certificate must have been selected before calling this function.
Supported by
           Windows.

Parameters
cipherInput cipher in base64 format which is desired to be decrypted.
Returns
Decrypted data if succeeded
Or an ErrorCode

◆ FindCertificate()

string Dastine::FindCertificate ( string  issuerDn,
string  keyUsages 
)

return a list of subjectDN from all certificates in store windows
Supported by
           Windows.

Parameters
issuerDnSubjectDN of Issuer certificate which displaying certificates are filtered by that issuer.
keyUsagesKey usages which displaying certificates are filtered by them. More than one key usage can be passed using "&" symbol.
Possible values are:
         Digital_Signature
         Non_repudiation
         Key_encipherment
         Data_encipherment
         Key_agreement
         Client_Authentication
         Email_Protection
         SSH_Client
         MS_SmartCard_Logon
         MS_Document_Signing
         PDF_Signing
Returns
   list of subjectDN separated using "|" symbol.
Or an ErrorCode

◆ GenerateCertificateRequestBySelectedCertificate()

string Dastine::GenerateCertificateRequestBySelectedCertificate ( void  )

Generates a CSR for certificate issuance. A handle is created on selected certificate on the token is being cached until the certificate in issued and imported on the token using ImportIssuedCertificate() function. This is important to maintain the state of Dastine object until the certificate is imported on the token, otherwise the handle is destroyed and the process should be repeated.
Supported by
           Windows.

Parameters
void
Returns
CSR in base64 format if succeeded
Or an ErrorCode

◆ GenerateKeyPairAndCertificateRequest()

string Dastine::GenerateKeyPairAndCertificateRequest ( string  subjectDN,
string  keyLength,
string  tokenName 
)

Generates a CSR for certificate issuance. A handle to generated key pair on the token is being cached until the certificate in issued and imported on the token using ImportIssuedCertificate() function. This is important to maintain the state of Dastine object until the certificate is imported on the token, otherwise the handle is destroyed and the process should be repeated.
Supported by
           Windows.

Parameters
subjectDNDesired subject for new certificate. Acceptable values are :
CN, O, OU, SERIALNUMBER, C, ST(S), LOCALITY(L), TITLE(T), SURNAME(SN), GIVENNAME(GN,G), INITIALS, E, DC, UNSTRUCTUREDNAME, UNSTRUCTUREDADDRESS, UID, STREETADDRESS(STREET), DESCRIPTION, BUSINESSCATEGORY, POSTALCODE, POSTALADDRESS, DNQUALIFIER, TELEPHONENUMBER. Also you can put the number of OIDs.
keyLengthKey length of new key pair which is being generated.
tokenNameThe name of CSP with which the CSR is being generated. This name can be obtained using ListTokens() function.
Returns
CSR in base64 format if succeeded
Or an ErrorCode

◆ GenerateKeyPairAndCertificateRequestOnSelectedCertificate()

string Dastine::GenerateKeyPairAndCertificateRequestOnSelectedCertificate ( string  subjectDN,
string  keyLength,
string  tokenName 
)

Generates a CSR for certificate issuance. A handle is created on selected certificate to generated key pair on the IDin is being cached until the certificate in issued and imported on the IDin using ImportIssuedCertificateOnSelectedCertificate() function. This is important to maintain the state of Dastine object until the certificate is imported on the IDin, otherwise the handle is destroyed and the process should be repeated.
Supported by
           Windows.

Parameters
subjectDNDesired subject for new certificate.
keyLengthKey length of new key pair which is being generated.
tokenNameThe name of CSP with which the CSR is being generated. This name can be obtained using ListTokens() function.
Returns
CSR in base64 format if succeeded
Or an ErrorCode

◆ GenerateKeyPairAndCertificateRequestWithSANS()

String Dastine::GenerateKeyPairAndCertificateRequestWithSANS ( String  subjectDN,
String  keyLength,
String  tokenName,
string  UPN,
string  RFC822_NAME,
string  DNS_NAME,
string  URI,
string  DIRECTORY_NAME,
string  IP_ADDRESS,
string  REGISTERED_ID 
)

Generates a CSR for certificate issuance with subject alternative names. A handle to generated key pair on the token is being cached until the certificate in issued and imported on the token using ImportIssuedCertificate() function. This is important to maintain the state of Dastine object until the certificate is imported on the token, otherwise the handle is destroyed and the process should be repeated.
Supported by
           Windows.

Parameters
subjectDNDesired subject for new certificate. Acceptable values are :
CN, O, OU, SERIALNUMBER, C, ST(S), LOCALITY(L), TITLE(T), SURNAME(SN), GIVENNAME(GN,G), INITIALS, E, DC, UNSTRUCTUREDNAME, UNSTRUCTUREDADDRESS, UID, STREETADDRESS(STREET), DESCRIPTION, BUSINESSCATEGORY, POSTALCODE, POSTALADDRESS, DNQUALIFIER, TELEPHONENUMBER. Also you can put the number of OIDs.
keyLengthKey length of new key pair which is being generated.
tokenNameThe name of CSP with which the CSR is being generated. This name can be obtained using ListTokens() function.
UPNDesired user principal name for new certificate.
RFC822_NAMEDesired RFC822 name for new certificate. More than one RFC822_NAME can be passed using "," symbol.
DNS_NAMEDesired DNS name for new certificate. More than one DNS_NAME can be passed using "," symbol.
URIDesired URI for new certificate. More than one URI can be passed using "," symbol.
DIRECTORY_NAMENot Supported.leave this parameter empty string.
IP_ADDRESSNot Supported.leave this parameter empty string.
REGISTERED_IDNot Supported.leave this parameter empty string.
Returns
CSR in base64 format if succeeded
Or an ErrorCode

◆ GetFingerPrintScannerSupportedDevices()

string Dastine::GetFingerPrintScannerSupportedDevices ( void  )

Gets the status of supported and connected scanner devices.
Supported by
           Windows.

Parameters
void
Returns
A JSON string which lists the supported scanner devices and status of them. If scanner device is connected to machine and supported by dastine, the status value is "connected", otherwise is "not connected".
Or an ErrorCode

◆ GetProviderName()

string Dastine::GetProviderName ( void  )

Returns the provider name of selected certificate.
Supported by
           Windows.

Parameters
void
Returns
The provider name of selected certificate if succeeded
Or an ErrorCode

◆ GetSelectedCertificate()

string Dastine::GetSelectedCertificate ( void  )

Returns the selected certificate.
Supported by
           Android and Windows.

Parameters
void
Returns
The selected certificate in base64 format if succeeded
Or an ErrorCode

◆ GetVersion()

string Dastine::GetVersion ( void  )

Get the current version of Dastine.
Supported by
           Android and Windows.

Parameters
void
Returns
A string containing the current version of Dastine.

◆ ImportCertificateFromFileToToken()

int Dastine::ImportCertificateFromFileToToken ( string  p12,
string  password,
string  tokenName,
string  keyContainer 
)

Imports a certificate from file to the token.
Supported by
           Windows.

Parameters
p12input certificate in base64 format
passwordThe password of the p12 file
tokenNameThe name of CSP into which the certificate is imported. This name can be obtained using ListTokens() function.
keyContainerThe index of keyContainer on IDin card. For specific the index of keyContainer you must set IDin card by method SetIDinCard().
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ ImportIssuedCertificate()

int Dastine::ImportIssuedCertificate ( string  certificate)

Imports the issued certificate on the token. The certificate is imported on the cached handle to the generated key pair. A CSR must have been generated before calling this function.
Supported by
           Windows.

Parameters
certificateinput issued certificate in base64 format
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ ImportIssuedCertificateOnSelectedCertificate()

int Dastine::ImportIssuedCertificateOnSelectedCertificate ( string  certificate)

Imports the issued certificate on the IDin. The certificate is imported on the selected certificate. A CSR must have been generated before calling this function.
Supported by
           Windows.

Parameters
certificateinput issued certificate in base64 format
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ InstallUpdate()

int Dastine::InstallUpdate ( )

Install downloaded update from server.
Supported by
           Windows.

Parameters
void
Returns
117   E_UPDATE_INSTALL_RUNED
Or an ErrorCode

◆ ListTokens()

string Dastine::ListTokens ( void  )

Returns the list of installed CSP's on client's machine.

Parameters
void
Returns
List of installed CSPs on client machine separated using "|" symbol.
Or an ErrorCode

◆ NIDAuthenticateByFinger()

string Dastine::NIDAuthenticateByFinger ( string  smartCardReaderName,
string  index,
string  imageData,
string  imageWidth,
string  imageHeight,
string  imageResolution 
)

Authenticates by fingerprint of national Id card. A dialog box is displayed for get fingerprint.
Supported by
           Windows.

Parameters
smartCardReaderNameinput the name of connected smart card reader. If you put this parameter null, the smart card redaer with national Id card will selected automatically, and if more than one smart card reader with national Id card connected to machine, the UI for selecting specific smart card reader is displayed.
indexinput the number of specific finger index. If you put this value '0', means fingerprint is not available and authenticate methode is changed to PIN_PIN.
imageDatainput the data of fingerprint image in base64 format.
imageWidthinput the value of fingerprint image width.
imageHeightinput the value of fingerprint image height.
imageResolutioninput the value of fingerprint image resolution.
Returns
A JSON string which made by Matiran.
Or an ErrorCode

◆ NIDAuthenticateByFingerUI()

string Dastine::NIDAuthenticateByFingerUI ( string  smartCardReaderName)

Authenticates by fingerprint of national Id card. A dialog box is displayed for get fingerprint.
Supported by
           Windows.

Parameters
smartCardReaderNameinput the name of connected smart card reader. If you put this parameter null, the smart card redaer with national Id card will selected automatically, and if more than one smart card reader with national Id card connected to machine, the UI for selecting specific smart card reader is displayed.
Returns
A JSON string which made by Matiran.
Or an ErrorCode

◆ NIDAuthenticateByPIN()

string Dastine::NIDAuthenticateByPIN ( string  smartCardReaderName)

Authenticates by PIN of national Id card. A dialog box is displayed for enter PIN.
Supported by
           Windows.

Parameters
smartCardReaderNameinput the name of connected smart card reader. If you put this parameter null, the smart card reader with national Id card will selected automatically, and if more than one smart card reader with national Id card connected to machine, the UI for selecting specific smart card reader is displayed.
Returns
A JSON string which made by Matiran.
Or an ErrorCode

◆ NIDChangePIN()

string Dastine::NIDChangePIN ( string  smartCardReaderName,
string  pinType,
string  oldPin,
string  newPin 
)

Not Supported

◆ NIDGetFingerIndex()

string Dastine::NIDGetFingerIndex ( string  smartCardReaderName)

Get the saved finger's status of connected national Id card.
Supported by
           Windows.

Parameters
smartCardReaderNameinput the name of connected smart card reader. If you put this parameter null, the smart card reader with national Id card will selected automatically, and if more than one smart card reader with national Id card connected to machine, the UI for selecting specific smart card reader is displayed.
Returns
A JSON string which made by Matiran.
Or an ErrorCode

◆ NIDSetDSAuthToken()

string Dastine::NIDSetDSAuthToken ( string  authenticationToken)

Set token for connecting to DS.
Supported by
           Windows.

Parameters
authenticationTokeninput a received token for connecting to document signer server.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ NIDSign()

string Dastine::NIDSign ( string  smartCardReaderName,
string  data 
)

Signs the input data using the national Id card. A dialog box is displayed for enter PIN.
Supported by
           Windows.

Parameters
smartCardReaderNameinput the name of connected smart card reader. If you put this parameter null, the smart card redaer with national Id card will selected automatically, and if more than one smart card reader with national Id card connected to machine, the UI for selecting specific smart card reader is displayed.
dataInput data in base64 format which is desired to be signed.
Returns
A JSON string which made by Matiran.
Or an ErrorCode

◆ NIDUnblockPIN()

string Dastine::NIDUnblockPIN ( string  smartCardReaderName,
string  pinType 
)

Unblock national Id card's PIN. A dialog box is displayed for enter PIN.
Supported by
           Windows.

Parameters
smartCardReaderNameinput the name of connected smart card reader. If you put this parameter null, the smart card redaer with national Id card will selected automatically, and if more than one smart card reader with national Id card connected to machine, the UI for selecting specific smart card reader is displayed.
pinTypetype of specific PIN. ID_PIN and SIGN_PIN can be selected.
Returns
A JSON string which made by Matiran.
Or an ErrorCode

◆ ReadCustomField()

string Dastine::ReadCustomField ( int  index)

Reads custom field data from IDin Cards.
Supported by
           Android and Windows.

Parameters
indexThe index of CustomField
Returns
CustomField from IDin Card in b64 format
Or an ErrorCode

◆ ReadExtendedPrintedData()

string Dastine::ReadExtendedPrintedData ( void  )

Reads extended printed data from IDin Cards.
Supported by
           Android and Windows.

Parameters
void
Returns
ExtendedPrintedData from IDin Card in b64 tlv format
Or an ErrorCode

◆ ReadFaceImage()

int Dastine::ReadFaceImage ( void  )

Reads face image from IDin Cards.
Supported by
           Android and Windows.

Parameters
void
Returns
Face image from IDin Card in b64 format
Or an ErrorCode

◆ ReadFingerprintImage()

int Dastine::ReadFingerprintImage ( void  )

Reads fingerprint image from IDin Cards.
Supported by
           Android and Windows.

Parameters
void
Returns
Fingerprint image from IDin Card in b64 format
Or an ErrorCode

◆ ReadIDinCardsSerialNumber()

string Dastine::ReadIDinCardsSerialNumber ( void  )

Reads serial number data from IDin Cards.
Supported by
           Windows.

Parameters
void
Returns
SerialNumber List from serial number connected IDin Cards in b64 format separated using "|" symbol
Or an ErrorCode

◆ ReadPrintedData()

string Dastine::ReadPrintedData ( void  )

Reads printed data from IDin Cards.
Supported by
           Android and Windows.

Parameters
void
Returns
PrintedData from IDin Card in b64 tlv format
Or an ErrorCode

◆ ReadSerialNumber()

string Dastine::ReadSerialNumber ( void  )

Reads serial number data from IDin Card. A certificate must have been selected before calling this function.
Supported by
           Android and Windows.``

Parameters
void
Returns
SerialNumber from IDin Card in b64 format
Or an ErrorCode

◆ ReadSignatureImage()

int Dastine::ReadSignatureImage ( void  )

Reads signature image from IDin Cards.
Supported by
           Android and Windows.

Parameters
void
Returns
Signature image from IDin Card in b64 format
Or an ErrorCode

◆ ReadValidationData()

string Dastine::ReadValidationData ( void  )

Reads validation data from IDin Cards.
Supported by
           Android and Windows.

Parameters
void
Returns
ValidationData from IDin Card in b64 format
Or an ErrorCode

◆ RemoveGeneratedKeyPair()

int Dastine::RemoveGeneratedKeyPair ( void  )

Removes the generated key pair from token and releases the handle to this key pair.
Supported by
           Windows.

Parameters
void
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ RemoveSelectedCertificate()

int Dastine::RemoveSelectedCertificate ( void  )

Removes the selected certificate from token.
Supported by
           Windows.

Parameters
void
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ Reset()

int Dastine::Reset ( void  )

Resets everything in Dastine object releasing all handles and stopping every waiting for events.
Supported by
           Android and Windows.

Parameters
void
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SelectCertificateByThumbprint()

int Dastine::SelectCertificateByThumbprint ( string  thumbprint)

Selects a specific certificate from client's "Current_User" store matching with the input thumbprint. The selected certificate is cached inside the object and further cryptographic tasks like signing or decrypting is done using this certificate. This certificate can be retrieved using GetSelectedCertificate() function.
Supported by
           Windows.

Parameters
thumbprintThumbprint of desired certificate in base64 format.
hashAlgNot supported. leave this parameter empty string.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SelectCertificateFromFileBySubject()

int Dastine::SelectCertificateFromFileBySubject ( string  subject,
string  issuerDn,
string  keyUsages,
string  p12,
string  password 
)

Selects a specific certificate from a p12 file matching with the input subjectDn. Selecting certificate can be filtered using two other input parameters, issuer and key usages. The selected certificate is cached inside the object and further cryptographic tasks like signing or decrypting is done using this certificate. This certificate can be retrieved using GetSelectedCertificate() function.
Supported by
           Windows.

Parameters
subjectSubjectDN of desired certificate.
issuerDnSubjectDN of Issuer certificate which displaying certificates are filtered by that issuer.
keyUsagesKey usages which displaying certificates are filtered by them. More than one key usage can be passed using "&" symbol.
Possible values are:
         Digital_Signature
         Non_repudiation
         Key_encipherment
         Data_encipherment
         Key_agreement
         Client_Authentication
         Email_Protection
         SSH_Client
         MS_SmartCard_Logon
         MS_Document_Signing
         PDF_Signing
p12input file in base64 format.
passwordThe p12 file's password.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SelectCertificateFromFileByUI()

int Dastine::SelectCertificateFromFileByUI ( string  issuerDn,
string  keyUsages,
string  p12,
string  password 
)

Displays a dialog box that allows the selection of a certificate from a p12 file. Selecting certificate can be filtered using two input parameters, issuer and key usages. The selected certificate is cached inside the object and further cryptographic tasks like signing or decrypting is done using this certificate. This certificate can be retrieved using GetSelectedCertificate() function.
Supported by
           Windows.

Parameters
issuerDnSubjectDN of Issuer certificate which displaying certificates are filtered by that issuer.
keyUsagesKey usages which displayin g certificates are filtered by them. More than one key usage can be passed using "&" symbol.
Possible values are:
         Digital_Signature
         Non_repudiation
         Key_encipherment
         Data_encipherment
         Key_agreement
         Client_Authentication
         Email_Protection
         SSH_Client
         MS_SmartCard_Logon
         MS_Document_Signing
         PDF_Signing
p12input file in base64 format.
passwordThe p12 file's password.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SelectCertificateFromTokenBySubject()

int Dastine::SelectCertificateFromTokenBySubject ( LPCWSTR  subject,
string  issuerDn,
string  keyUsages 
)

Selects a specific certificate from hardware tokens connected to client's machine matching with the input subjectDn. Selecting certificate can be filtered using two other input parameters, issuer and key usages. The selected certificate is cached inside the object and further cryptographic tasks like signing or decrypting is done using this certificate. This certificate can be retrieved using GetSelectedCertificate() function.
Supported by
           Windows.

Parameters
subjectSubjectDN of desired certificate.
issuerDnSubjectDN of Issuer certificate which displaying certificates are filtered by that issuer.
keyUsagesKeyusages which displaying certificates are filtered by them. More than one key usage can be passed using "&" symbol.
Possible values are:
         Digital_Signature
         Non_repudiation
         Key_encipherment
         Data_encipherment
         Key_agreement
         Client_Authentication
         Email_Protection
         SSH_Client
         MS_SmartCard_Logon
         MS_Document_Signing
         PDF_Signing
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SelectCertificateFromTokenByUI()

int Dastine::SelectCertificateFromTokenByUI ( string  issuerDn,
string  keyUsages 
)

Displays a dialog box that allows the selection of a certificate from hardware tokens connected to client's machine. Displaying certificates can be filtered using two input parameters, issuer and key usages. The selected certificate is cached inside the object and further cryptographic tasks like signing or decrypting is done using this certificate. This certificate can be retrieved using GetSelectedCertificate() function.
Supported by
           Android and Windows.

Parameters
issuerDnSubjectDN of Issuer certificate which displaying certificates are filtered by that issuer.
keyUsagesKey usages which displaying certificates are filtered by them. More than one key usage can be passed using "&" symbol.
Possible values are:
         Digital_Signature
         Non_repudiation
         Key_encipherment
         Data_encipherment
         Key_agreement
         Client_Authentication
         Email_Protection
         SSH_Client
         MS_SmartCard_Logon
         MS_Document_Signing
         PDF_Signing
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SelectCertificateFromWindowsBySubject()

int Dastine::SelectCertificateFromWindowsBySubject ( string  subject,
string  issuerDn,
string  keyUsages 
)

Selects a specific certificate from client's "Current_User" store matching with the input subjectDn. Selecting certificate can be filtered using two other input parameters, issuer and key usages. The selected certificate is cached inside the object and further cryptographic tasks like signing or decrypting is done using this certificate. This certificate can be retrieved using GetSelectedCertificate() function.
Supported by
           Windows.

Parameters
subjectSubjectDN of desired certificate.
issuerDnSubjectDN of Issuer certificate which displaying certificates are filtered by that issuer.
keyUsagesKeyusages which displaying certificates are filtered by them. More than one key usage can be passed using "&" symbol.
Possible values are:
         Digital_Signature
         Non_repudiation
         Key_encipherment
         Data_encipherment
         Key_agreement
         Client_Authentication
         Email_Protection
         SSH_Client
         MS_SmartCard_Logon
         MS_Document_Signing
         PDF_Signing
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SelectCertificateFromWindowsByUI()

int Dastine::SelectCertificateFromWindowsByUI ( string  issuerDn,
string  keyUsages 
)

Displays a dialog box that allows the selection of a certificate from client's "Current_User" store. Displaying certificates can be filtered using two input parameters, issuer and keyusages. The selected certificate is cached inside the object and further cryptographic tasks like signing or decrypting is done using this certificate. This certificate can be retrieved using GetSelectedCertificate() function.
Supported by
           Android and Windows.

Parameters
issuerDnSubjectDN of Issuer certificate which displaying certificates are filtered by that issuer.
keyUsagesKey usages which displaying certificates are filtered by them. More than one key usage can be passed using "&" symbol.
Possible values are:
         Digital_Signature
         Non_repudiation
         Key_encipherment
         Data_encipherment
         Key_agreement
         Client_Authentication
         Email_Protection
         SSH_Client
         MS_SmartCard_Logon
         MS_Document_Signing
         PDF_Signing
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SetAdminKey()

int Dastine::SetAdminKey ( string  adminKey,
string  tokenName 
)

Sets AdminKey for IDin.
Supported by
           Windows.

Parameters
adminKeyIDin AdminKey in b64 format.
tokenNameThe name of CSP for which the AdminKey is set. This name can be obtained using ListTokens() function.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SetIDinCard()

int Dastine::SetIDinCard ( string  serialNumber)

Set an IDin card between other IDin cards connected to machine for working on it.
Supported by
           Windows.

Parameters
serialNumberinput the serial number of specific IDin card.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SetIDinCardIndexForIssuance()

int Dastine::SetIDinCardIndexForIssuance ( string  serialNumber)

Set index of keystore IDin for issuance. IDin card must set before calling this method by SetIDinCard();
Supported by
           Windows.

Parameters
Indexinput the number of specific keystore IDin. This number is between 0 to 3.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SetPIN()

int Dastine::SetPIN ( string  pin,
string  tokenName 
)

Sets pin for IDin.
Supported by
           Windows.

Parameters
pinToken pin.
tokenNameThe name of CSP for which the PIN is set. This name can be obtained using ListTokens() function.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SetPINGuide()

string Dastine::SetPINGuide ( string  guideText)

A phrase is displayed in dialog box for enter PIN.
Supported by
           Windows.

Parameters
guideTextinput a phrase in base64 format to display in dialog box for helping to client.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SetTokenInsertEvent()

int Dastine::SetTokenInsertEvent ( void  )

Sets an event for the hardware token. On this token's insertion, alert is displayed.
Supported by
           Windows.

Parameters
void
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ SetTokenRemoveEvent()

int Dastine::SetTokenRemoveEvent ( void  )

Sets an event for the selected certificate's hardware token. On this token's removal, alert is displayed.
Supported by
           Windows.

Parameters
void
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ Sign()

string Dastine::Sign ( string  data,
string  hashAlg 
)

Signs the input data using the selected certificate. A certificate must have been selected before calling this function.
Supported by
           Android and Windows.

Parameters
dataInput data in base64 format which is desired to be signed.
hashAlgHash algorithm used in signing process.
Possible values are:
         SHA1, SHA256, SHA384, SHA512
Returns
Signed data in base64 format if succeeded
Or an ErrorCode

◆ UnblockPIN()

int Dastine::UnblockPIN ( string  tokenName)

Unblock an IDin's PIN
Supported by
           Android and Windows.

Parameters
tokenNameThe name of CSP that it's PIN is going to be changed. This name can be obtained using ListTokens() function.
Returns
00   SUCCESSFUL
Or an ErrorCode

◆ UnicodeToBase64()

string Dastine::UnicodeToBase64 ( string  unicodeStr)

Converts a Unicode string to base64.
Supported by
           Android and Windows.

Parameters
unicodeStrInput Unicode string
Returns
Converted base64 string if succeeded
Or an ErrorCode