Supported .Net APIs
The .Net framework is language agnostic. Developed by Microsoft, this software framework provides language interoperability across several programming languages, so developers can use code written in different languages. A DLL that serves as the .Net Assembly exposes an interface that is understandable by all .Net languages.
Note
The user may use the obfuscated password or credential. See Creating Obfuscated Data Using Obfuscation Utility for more information.
In this chapter, the CT-V .Net API interface is written in .Net C#.
Note
The "JVM.dll" which resides within java installation directory must be in the path to call CT-V APIs from .Net.
You can use the fundamental API methods provided here by converting the calls into other languages that .Net supports. You may find it useful to refer to a website or book that provides side-by-side examples of C# code and the equivalent code in the language you want to use. Many sites provide such examples; here are a few samples:
http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx#Y0
http://www.dmoz.org/Computers/Programming/Languages/Comparison_and_Review/
http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)
Note
The CT-V .Net API provides all of the fundamental services provided by the Java API. You may find it useful to refer to documentation for the Java services if you have questions or encounter difficulties. Be aware that there are minor differences between the Java and .Net APIs; the .Net API documentation provided below represents CT-V’s currently supported features and capabilities.
The .Net API enables .Net developers to integrate the CT-V methods described below:
TokenService() and closeService() - start and close the CT-V service.
AttachCurrentThread() - initialize the thread environment.
createNewFormat() - create new token formats.
createMaskingFormat() - create new masking format.
insert() - create tokens and insert them into a Token Vault.
insertIrreversibleToken() - create irreversible tokens and insert them into a Token Vault.
mask() - create tokens without inserting them into a Token Vault.
get() - get plaintext values.
getDisabledTokens() - get an array of disabled tokens.
deleteToken() - delete the tokens.
deleteValue() - delete the tokens based on plaintext value.
deleteTokenEx() - delete tokens and get the exact number of tokens deleted.
deleteTokenByTokenProperty() - delete tokens on the basis of tokenProperty.
disableToken() - disable the tokens.
getToken() - check if a token exists in the token vault.
getTokensByDate() - retrieve all tokens created on or before a specific date.
getByTokenProperty() - get token(s) based on TokenProperty(s).
getCustomTokenProperty() - get customTokenProperty(s) based on token(s).
getCustomTokenPropertyByValue() - get customTokenProperty(s) based on plaintext value(s) and custom data.
getTokensByRangeDate() - retrieve all tokens created between a specific date range.
getVersion() - return the CT-V software version.
updateTokenProperty() - update the token properties for the tokens.
detachCurrentThread() - clean up the thread environment.
Configure bulk token processing parameters for certain CT-V API methods, as defined later in this chapter. Your application must use the TokenServiceNS namespace to work with the API. See Installing CipherTrust Vaulted Tokenization for more information.
The formal definition of the namespace and its contents is provided below. Immediately following is a section providing .Net method details that will help you apply these methods successfully. Be aware that some of the method names are overloaded; pay attention to the different parameters you can use, and the order in which they are required.
TokenService Namespace
The namespace is TokenServiceNS. The CT-V installation process will build and populate this namespace for you.
Public Class - TokenService
public ref class TokenService
Token Formats
The token formats listed below are used throughout CT-V. Refer to Token Formats for information on these formats.
public static int RANDOM_TOKEN;
public static int RANDOM_ALPHANUMERIC_TOKEN;
public static int ALPHANUMERIC_TOKEN;
public static int SEQUENTIAL_TOKEN;
public static int LAST_FOUR_TOKEN;
public static int FIRST_SIX_TOKEN;
public static int FIRST_TWO_LAST_FOUR_TOKEN;
public static int FIRST_SIX_LAST_FOUR_TOKEN;
public static int FIXED_NINETEEN_TOKEN;
public static int FIXED_TWENTY_LAST_FOUR_TOKEN;
public static int EMAIL_ADDRESS_TOKEN;
public static int DATE_MMDDYYYY_TOKEN;
public static int DATE_DDMMYYYY_TOKEN;
public static int DATE_YYYYMMDD_TOKEN;
public static int FIRST_SIX_LAST_FOUR_FAIL_LUHN_TOKEN;
public static int FIXED_FIRST_TWO_LAST_FOUR_FAIL_LUHN_TOKEN;
public static int SHA2_256_BASE16_TOKEN;
public static int SHA2_384_BASE16_TOKEN;
public static int SHA2_512_BASE16_TOKEN;
public static int SHA2_256_BASE64_TOKEN;
public static int SHA2_384_BASE64_TOKEN;