Loading…

Kryptel/Java

ISilverKeyStream interface

Declaration

package com.kryptel.silver_key;

public interface ISilverKeyStream {
  void CreateDirectory(String targetedPath) throws Exception;

  void StoreFile(String targetedPath, String srcPath) throws Exception;
  void StoreTree(String targetedPath, String srcPath) throws Exception;

  void AddMessage(String message) throws Exception;
}

Description

Silver Key parcel is actually a script – a sequence of commands that decryptor is executing. ISilverKeyStream contains methods to write the script commands.

Parcel creation consists of three steps: on the first step the calling program uses ISilverKeyParcel to initialize parcel building and to create the parcel file. On the next step it calls ISilverKeyStream methods to create the parcel script. On the last step a call to ISilverKeyParcel.Close flushes accumulated script commands and finalizes the parcel.

You can use Parcel Analyzer program included in the Silver Key product to peek inside a parcel and selectively execute its script commands.

CreateDirectory

void CreateDirectory(String targetedPath) throws Exception;

Instructs the decryptor to create a directory on recipient's computer. The argument is a targeted path in the form <target>|path, for example, My Documents|Reports/June.

The part preceding the '|' separator is a user-friendly target name (see Targets class for a discussion of targets). The part after the separator is a path relative to the specified target.

StoreFile

void StoreFile(String targetedPath, String srcPath) throws Exception;

Adds the file srcPath to the parcel. The file will be decrypted to targetedPath on recipient's computer. See CreateDirectory description above for a discussion on targeted paths.

Note that targetedPath is the file's path, not the directory to write to. That is, both targetedPath and srcPath must include the file name, even if it is same (and most likely it is).

StoreTree

void StoreTree(String targetedPath, String srcPath) throws Exception;

Adds the directory srcPath to the parcel with all the directories and the files it contains. The whole tree will be decrypted to targetedPath on recipient's computer. See CreateDirectory description above for a discussion on targeted paths.

Note that targetedPath is the tree top directory's path, not the directory to decrypt to. That is, both targetedPath and srcPath must include the tree top directory name, even if it is same (and most likely it is).

AddMessage

void AddMessage(String message) throws Exception;

Adds an encrypted message, which will be shown to parcel recipient.

Note that script is executed in the same order as it was created. If you add two encrypted messages, the first added will be the first shown.