CREATEGENVALTOKENFORMAT
Create a new token format which either generates a token based on ITokenGenerator
or validates a token based on ITokenValidator
.
Import Parameters
ITOKENGEN - Allows users to create custom tokenization functions that define the way data is tokenized.
Following code snippet explains the procedure of implementing itokengenerator:
There is an interface in the CT-V jarfile.
public interface com.safenet.token.ITokenGenerator { public String generateToken( String value ) throws TokenException; }
Define a class that implements the interface.
package com.customer.code.tokenizers; class MyTokenizer implements com.safenet.token.ITokenGenerator { String generateToken( String value ) throws TokenException { // For simplicity, defers to customer tokenizer function. return tokenizeFunction( value ); } }
Create a jar and place it in the
<SAP Binaries>\lib\classes
.Note
<SAP Binaries>
is the location set during installation. Refer to Installing SAP Binaries for details.Restart the SAPTM windows service.
Enter the value for this parameter as:
com.customer.code.tokenizers.MyTokenizer
.
ITOKENVAL - Allows the user to create custom token validation functions, even though CT-V still creates the token.
Following code snippet explains the procedure of implementing itokenvalidator:
There is an interface in the CT-V jarfile.
public interface com.safenet.token.ITokenValidator { public Boolean isValid( String value ) throws TokenException; }
Define a class to validate the generated token.
package com.customer.code.validators; class MyValidator implements ITokenValidator { Boolean isValid( String value ) throws TokenException { return isTokenToMyLiking( value ); } }
Create a jar and place it in the
<SAP Binaries>\lib\classes
.Note
<SAP Binaries>
is the location set during installation. Refer to Installing SAP Binaries for details.Restart the SAPTM windows service.
Enter the value for this parameter as:
com.customer.code.validators.MyValidator
.
VALIDATORFORMAT - The format in which token is required.
From the common parameters, refer to the source code below for exact parameters.
Note
A token is either generated or validated so, either ITOKENGEN or ITOKENVAL parameter is specified.
Export Parameters
- FORMATNUMBER - The integer representing the new token format. This value will be greater than 100.
Source Code
FUNCTION CREATEGENVALTOKENFORMAT.
----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(NAEUSER) TYPE STRING
*" VALUE(NAEPASSWORD) TYPE STRING
*" VALUE(DBUSER) TYPE STRING
*" VALUE(DBPASSWORD) TYPE STRING
*" VALUE(ITOKENGEN) TYPE STRING
*" VALUE(ITOKENVAL) TYPE STRING
*" VALUE(VALIDATORFORMAT) TYPE INTEGER
*" EXPORTING
*" VALUE(FORMATNUMBER) TYPE INTEGER
----------------------------------------------------------------------
ENDFUNCTION.