jPOS 1.6.1 API Documentation

org.jpos.security
Class CryptographicServiceMessage

java.lang.Object
  extended by org.jpos.security.CryptographicServiceMessage
All Implemented Interfaces:
Loggeable

public class CryptographicServiceMessage
extends java.lang.Object
implements Loggeable

Cryptographic Service Message (CSM for short). A message for transporting keys or related information used to control a keying relationship. It is typically the contents of ISOField(123). For more information refer to ANSI X9.17: Financial Institution Key Mangement (Wholesale).

Version:
$Revision: 2594 $ $Date: 2008-01-22 08:41:31 -0800 (Tue, 22 Jan 2008) $
Author:
Hani S. Kirollos

Nested Class Summary
static class CryptographicServiceMessage.ParsingException
           
 
Field Summary
static java.lang.String MCL_ESM
           
static java.lang.String MCL_KSM
           
static java.lang.String MCL_RSI
           
static java.lang.String MCL_RSM
           
static java.lang.String TAG_CTP
           
static java.lang.String TAG_CTR
           
static java.lang.String TAG_ERF
           
static java.lang.String TAG_KD
           
static java.lang.String TAG_ORG
           
static java.lang.String TAG_RCV
           
static java.lang.String TAG_SVR
           
 
Constructor Summary
CryptographicServiceMessage()
           
CryptographicServiceMessage(java.lang.String mcl)
          Creates a CSM and sets its Message Class
 
Method Summary
 void addField(java.lang.String tag, java.lang.String content)
          adds a field to the CSM
 void dump(java.io.PrintStream p, java.lang.String indent)
          dumps CSM basic information
 java.lang.String getFieldContent(java.lang.String tag)
          Returns the field content of a field with the given tag
 java.lang.String getMCL()
           
static CryptographicServiceMessage parse(java.lang.String csmString)
          Parses a csm string
 void setMCL(java.lang.String mcl)
           
 java.lang.String toString()
          Formats the CSM as a string, suitable for transfer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MCL_RSI

public static final java.lang.String MCL_RSI
See Also:
Constant Field Values

MCL_KSM

public static final java.lang.String MCL_KSM
See Also:
Constant Field Values

MCL_RSM

public static final java.lang.String MCL_RSM
See Also:
Constant Field Values

MCL_ESM

public static final java.lang.String MCL_ESM
See Also:
Constant Field Values

TAG_RCV

public static final java.lang.String TAG_RCV
See Also:
Constant Field Values

TAG_ORG

public static final java.lang.String TAG_ORG
See Also:
Constant Field Values

TAG_SVR

public static final java.lang.String TAG_SVR
See Also:
Constant Field Values

TAG_KD

public static final java.lang.String TAG_KD
See Also:
Constant Field Values

TAG_CTP

public static final java.lang.String TAG_CTP
See Also:
Constant Field Values

TAG_CTR

public static final java.lang.String TAG_CTR
See Also:
Constant Field Values

TAG_ERF

public static final java.lang.String TAG_ERF
See Also:
Constant Field Values
Constructor Detail

CryptographicServiceMessage

public CryptographicServiceMessage()

CryptographicServiceMessage

public CryptographicServiceMessage(java.lang.String mcl)
Creates a CSM and sets its Message Class

Parameters:
mcl - message class name. e.g. MCL_KSM, MCL_RSM...
Method Detail

setMCL

public void setMCL(java.lang.String mcl)

getMCL

public java.lang.String getMCL()

addField

public void addField(java.lang.String tag,
                     java.lang.String content)
adds a field to the CSM

Parameters:
tag - Field Tag
content - Field Content, can't be null, use an empty string ("") instead
Throws:
java.lang.NullPointerException - if tag or content is null

getFieldContent

public java.lang.String getFieldContent(java.lang.String tag)
Returns the field content of a field with the given tag

Parameters:
tag -
Returns:
field Field Content, or null if tag not found

toString

public java.lang.String toString()
Formats the CSM as a string, suitable for transfer. This is the inverse of parse

Overrides:
toString in class java.lang.Object
Returns:
the CSM in string format

dump

public void dump(java.io.PrintStream p,
                 java.lang.String indent)
dumps CSM basic information

Specified by:
dump in interface Loggeable
Parameters:
p - a PrintStream usually supplied by Logger
indent - indention string, usually suppiled by Logger
See Also:
Loggeable

parse

public static CryptographicServiceMessage parse(java.lang.String csmString)
                                         throws CryptographicServiceMessage.ParsingException
Parses a csm string

Parameters:
csmString -
Returns:
CSM object
Throws:
CryptographicServiceMessage.ParsingException

jPOS.org