XCMS Toolkit

com.cms.crypto
Class DESWithEDE

java.lang.Object
  extended by schemajic.model.ASN1Value
      extended by schemajic.model.ASN1Sequence
          extended by com.cms.types.ContentEncryptionAlgorithmIdentifier
              extended by com.cms.crypto.ContentEncryptionAlgorithmIdentifierWithIV
                  extended by com.cms.crypto.DESWithEDE

public class DESWithEDE
extends ContentEncryptionAlgorithmIdentifierWithIV

Creates a content encryption algorithm identifier or a symmetric key encryption algorithm identifier for the DES/EDE (Triple DES) cipher algorithm in Cipher Block Chaining (CBC) mode. ASN.1 defined types ContentEncryptionAlgorithmIdentifier and KeyEncryptionAlgorithmIdentifier are used in different contexts, but have identical schemas.

 ContentEncryptionAlgorithmIdentifier ::= SEQUENCE {
    algorithm   ALGORITHM.&id({ContentEncryptionAlgorithms}),
    parameters  ALGORITHM.&Type({ContentEncryptionAlgorithms}{@algorithm})  OPTIONAL
 }
 
 ContentEncryptionAlgorithms ALGORITHM ::= {
    ...  -- Expect additional objects --
 }
 
 KeyEncryptionAlgorithmIdentifier ::= SEQUENCE {
    algorithm   ALGORITHM.&id({ContentEncryptionAlgorithms}),
    parameters  ALGORITHM.&Type({ContentEncryptionAlgorithms}{@algorithm})  OPTIONAL
 }
 
 KeyEncryptionAlgorithms ALGORITHM ::= {
    ...  -- Expect additional objects --
 } 
The parameters component of these two types is an ASN.1 "open type", which must contain the complete encoding of a value of some ASN.1 type. The ASN.1 encoding rule used to form the value of the open type is controlled by the user. So, in this tool kit, the encoded value in the open type may be a value encoded in DER or or XER.

For this cipher algorithm, the open type must contain the complete encoding of a value of ASN.1 type IV, an eight octet string, which itself is a value of ASN.1 type OCTET STRING.

The value of an open type is not visible to the codec, which conforms to the requirements for open types in the ASN.1 standards. So, the value of the parameters component of ASN.1 type ContentEncryptionAlgorithmIdentifier and KeyEncryptionAlgorithmIdentifier must be pre-encoded and set before the values of these algorithm identifier types themselves can be encoded.

Version:
1.00 - 2006/01/25
Author:
support@phillipgriffin.com

Field Summary
 
Fields inherited from class schemajic.model.ASN1Sequence
_fields
 
Method Summary
static DESWithEDE createForDER(byte[] iv)
          Creates an DXER encoded Triple DES value of an ASN.1 algorithm identifier
static DESWithEDE createForXER(byte[] iv)
          Creates an XER encoded Triple DES value of an ASN.1 algorithm identifier
 
Methods inherited from class com.cms.types.ContentEncryptionAlgorithmIdentifier
getAlgorithm, getAsn1Type, getDefaultValue, getParameters, setAlgorithm, setParameters
 
Methods inherited from class schemajic.model.ASN1Sequence
accept, getFields, setAbsent, setFields, setPresent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createForXER

public static DESWithEDE createForXER(byte[] iv)
Creates an XER encoded Triple DES value of an ASN.1 algorithm identifier

Parameters:
iv - a 8 byte Triple DES cipher initialization vector
Returns:
a Triple DES algorithm identifier value
Throws:
java.lang.IllegalArgumentException

createForDER

public static DESWithEDE createForDER(byte[] iv)
Creates an DXER encoded Triple DES value of an ASN.1 algorithm identifier

Parameters:
iv - a 8 byte Triple DES cipher initialization vector
Returns:
an algorithm identifier
Throws:
java.lang.IllegalArgumentException

XCMS Toolkit


Copyright © 2005-2006 GRIFFIN Consulting. All Rights Reserved.