Interface DocumentCrypto<KeyType,​NameType,​DocSchemaType,​DocType>


public interface DocumentCrypto<KeyType,​NameType,​DocSchemaType,​DocType>
Work in progress -- may be altered considerably -- see below.

The document_crypto interface declares the minimal cryptographic services that are applied to negotiation documents as well as event messages. Documents are subjected to three layers of encryption as described here.

At each encryption layer, additional annotation may be added to a document first to provide context and documentation of the operation or to satisfy the protocol of the transaction.

Missing Part:This interface obviously lacks the ability to sign documents with the originator's certificate. Must add this soon!!

  • Method Summary

    Modifier and Type Method Description
    DocType innerEncrypt​(KeyType key, int sessionid, java.lang.String datestring, DocType doc, DocSchemaType schema, DocType extra)
    Inner encryption is a partial encryption with a one-way or symmetric key.
    DocSchemaType outerEncrypt​(KeyType key, java.lang.String name, java.lang.String datestring, DocType doc, DocType extra)
    Outer encryption uses a public key encryption algorithm with a supplied key.
  • Method Details

    • innerEncrypt

      DocType innerEncrypt​(KeyType key, int sessionid, java.lang.String datestring, DocType doc, DocSchemaType schema, DocType extra)
      Inner encryption is a partial encryption with a one-way or symmetric key. It is partial because it is guided by an extended document schema. In general, XML tags are not encrypted while everything else is subject to encryption.
      Parameters:
      key - the key used by the public key encryption algorithm
      sessionid - identity number for the encryption transaction (annotation)
      datestring - date of the encryption (annotation)
      doc - the document that should be encrypted.
      schema - information on the XML formating of the document
      extra - (annotation)
      Returns:
      the annotated and then encrypted document
    • outerEncrypt

      DocSchemaType outerEncrypt​(KeyType key, java.lang.String name, java.lang.String datestring, DocType doc, DocType extra)
      Outer encryption uses a public key encryption algorithm with a supplied key. That may be a private or public key.
      Parameters:
      key - the key used by the public key encryption algorithm
      name - the name associated with the key (annotation)
      datestring - date of the encryption (annotation)
      doc - the document that should be encrypted.
      extra - (annotation)
      Returns:
      the annotated and then encrypted document