Skip to main content

About the SDK

The Pi Soft Software Development Kit is an essential resource for developers implementing encryption within an enterprise.  The technical information presented in this sdk documentation is organized in two primary sections for each language.  The Development section contains sample code for basic development tasks.  The Reference section contains details of each class. Supplementary information about the kS's error messages and audit logs can be found in the Appendices.

Pi Soft sdk is available for

  • Java
  • C/C++

Functions relate to these categories

  • Network Communication and Authentication and Authorization
  • Cryptography
  • Administration

Function Categories
Authentication
  • User Name and Password (SRP)
  • X509 Certificate
  • LDAP (Kerberos) — build-dependent; not present in every shipped kS
Authorization
  • Role Based Authorization (RBAC)
    • Role and Operation
  • Discretionary Access Control (DAC)
    • T-Tag and Access Policies
  • Mandatory Access Control (MAC)
    • Group
Cryptography
  • Encryption/Decryption
    • Buffer
    • Matrix/2-D Array
    • File
  • Encryption Algorithm Selection
    • AES (AES-256 default; AES-128/192 selectable)
  • Cipher Key Export/Import
Communication
  • Socket and TLS
Administration
  • ACL Management
  • User/Group Management
  • Role Management
  • Certificate Management
  • System Configuration/Parameter Management
  • File System Configuration Management

Agents
For Java
  • File: TEAdmin.jar
  • Class File Compatibility: Java 8 — Eclipse Temurin (baseline jdk8u492-b09)
  • Java Packages
    • com.eruces.teagent
    • com.eruces.teadmin
    • com.eruces.teconfig
For C/C++
  • Files:
    • te_agent.dll/.so
    • te_agent_c.dll/.so
  • Dependent Libraries: dll and so
  • Namespace:  eruces

Examples of Code Samples (Java)

Many more Code Samples are available in each of the specific language sections.

Connect to kS with User Name and Password

//connection
TEAgentConnection conn = TEAgentConnectionFactory.getConnection(TEConnectionType.SECURE_SOCKET);

UPAuthenticationContext ctx =
(UPAutenticationContext)TEAgentConnectionFactory.
getAutehnicationContext(TEAuthenticationType.USERNAMEPASSWORD);

ctx.setUser(user);
ctx,setpasswd(pwd);
conn.open(server, port, ctx);

conn.close();

Principal ID and Cipher Algorithm

System.out.println("Principal ID: " + conn.getLoginID());

conn.setCipherAlgorithm(TECipherAlgorithmType.AES_256_cbc);
TECipherAlgorithmType alg - conn.getCipherAlgorithm(();
System.out.println("Algorithm Name: " + alg.getName());

|Principal ID: 3001
|Algorithm Name: AES-256-CBC

Encryption

TEAgentMatrix matrix = new TEAgentMatrix();
matrix.setRawElement("test1".getBytes(), 1, 1);
matrix.setRawElement("test1".getBytes(), 1,2);
conn.encrypt(matrix);

System.out.println(T-Tag: " + matrix.getHiddenLink(1));
System.out.println("Encrypted Value1: " + matrix.getElement(1, 1));
System.out.println("Encrypted Value2: " + matrix.getElement(1, 2));
conn.decrypt(matrix);
System.out.println("Decrypted Value1: " + new String(matrix.getRawElement(1,1)));
System.out.println("Decrypted Value2: " + new String(matrix.getRawElement(1,2)));

|T-Tag: AAAAE3kxK3vIrzp4ssoaQyJRtfe0i0e/GD8IqMQRYorGfOSx+4HCWQ==
|Encrypted Value1: 7pRIXV19Kit5ImruMOqXnA==
|Encrypted Value2: 0EkKhdnS1WAzQHVOevj1dw==
|Decrypted Value1: test1
|Decrypted Value2: test2

Get ACL

Administration admin = new Administration();
admin.attachConnection(conn);
ACLInfo acl = admin.getACL(matrix.getHiddenLink(1));
System.out.println(acl);
admin.detachConnection();

|ACLInfo:
<T-Tag: AAAAE8hTbQvhIoBjezf8v/Gs81R8Clz9kt5ytzmAaRDzmVTygan1PA== >
<Create Time: Wed Feb 29 16:50:00 CST 2012>
<ACLID: 26018 >
<Number of ACLEntries: 1 >
|ACLEntry:
<Principal ID: 3001 >
<Creation Time: Wed Feb 29 16:50:00 CST 2012>
<End Time: Wed Dec 31 18:00:00 CST 1969>
<Start Time: Wed Dec 31 18:00:00 CST 1969>
<Max Usage: -1 >
<ACL Right: 7 >
<ACLID: 26018 >
<User Rights: 0 >

Get Principals

PrincipalInfo[] principals = admin.getPrincipalList(new String[]{"UserAndPasswordInfo"});
for (int i=0; i<principals.length; i++)
{
System.out.println(principals[i]);
}
UserAndPasswordInfo:
UpdatableObject: <>
<System ID: 19 >
<Pricipal ID: 3001 >
<Role ID List: PList: {[<9,2>, <9,4>, <9,6>, <9,7>, <9,1001>]} >
<Group ID List: PList: {[<9,9008>, <9,9009>, <9,9010>, <9,9011>, <9,9013>]} >
<Default Group ID: 0 >
<Reviewer ID List: PList: {[]} >
<User Name: alice >

UserAndPasswordInfo:
UpdatableObject: <>
<System ID: 19 >
<Pricipal ID: 6001 >
<Role ID List: PList: {[<9,2>]} >
<Group ID List: PList: {[<9,9007>, <9,9010>, <9,9013>]} >
<Default Group ID: 0 >
<Reviewer ID List: PList: {[]} >
<User Name: bob >

Get Roles

Administration admin = new Administration();
admin.attachConnection(conn);
Role[] roles = admin.getAllRoles();
for (int i=0; i<roles.length; i++)
{
System.out.println(roles[i]);
}
admin.detachConnection();

Role:
<Role ID: 2 >
<Role Name: Encryptor >
<Role Type: 1 >
<Operation ID: PList: {(<9,16777217>, <9,16777218>, <9,16777219>)} >
Role:
<Role ID: 3 >
<Role Name: Exchanger >
<Role Type: 1 >
<Operation ID: PList: {(<9,33685504>, <9,100663297>, <9,100663299>)} >
Role:
<Role ID: 1001 >
<Role Name: Installer >
<Role Type: 0 >
<Operation ID: PList: {(<9,50331649>, <9,83886081>, <9,134217730>)} >

Get Operations

Administration admin = new Administration();
admin.attachConnection(conn);
Role[] roles = admin.getAllRoles();
for (int i=0; i<roles.length; i++)
{
System.out.println(roles[i]);
}
admin.detachConnection();

Role:
<Role ID: 2 >
<Role Name: Encryptor >
<Role Type: 1 >
<Operation ID: PList: {(<9,16777217>, <9,16777218>, <9,16777219>)} >
Role:
<Role ID: 3 >
<Role Name: Exchanger >
<Role Type: 1 >
<Operation ID: PList: {(<9,33685504>, <9,100663297>, <9,100663299>)} >
Role:
<Role ID: 1001 >
<Role Name: Installer >
<Role Type: 0 >
<Operation ID: PList: {(<9,50331649>, <9,83886081>, <9,134217730>)} >