XCMS Toolkit

com.cms.crypto
Class AES128WithCBC

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.AES128WithCBC

public class AES128WithCBC
extends ContentEncryptionAlgorithmIdentifierWithIV

Creates a content encryption algorithm identifier or a symmetric key encryption algorithm identifier for a 128-bit AES cipher algorithm using 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 AES-IV, a sixteen 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/02/12
Author:
support@phillipgriffin.com

Field Summary
 
Fields inherited from class schemajic.model.ASN1Sequence
_fields
 
Method Summary
static AES128WithCBC createForDER(byte[] aesIV)
          Creates a value of ASN.1 type ContentEncryptionAlgorithmIdentifier with a specified initialization vector pre-encoded for use in a binary encoding of a value of this type using the Distinguished Encoding Rules (DER) of ASN.1.
static AES128WithCBC createForXER(byte[] aesIV)
          Creates a value of ASN.1 type AES-IV, an initialization vector pre-encoded for use with XER ( XML encoding ) for use in a value of ASN.1 type ContentEncryptionAlgorithmIdentifier or ASN.1 type KeyEncryptionAlgorithmIdentifier.
 
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 AES128WithCBC createForXER(byte[] aesIV)
Creates a value of ASN.1 type AES-IV, an initialization vector pre-encoded for use with XER ( XML encoding ) for use in a value of ASN.1 type ContentEncryptionAlgorithmIdentifier or ASN.1 type KeyEncryptionAlgorithmIdentifier.

Parameters:
aesIV - a 16 byte AES initialization vector, which becomes a value of ASN.1 type AES-IV
Returns:
a value of ASN.1 type ContentEncryptionAlgorithmIdentifier for the 128-bit AES CBC mode cipher suitable for XML encoding
Throws:
java.lang.IllegalArgumentException

createForDER

public static AES128WithCBC createForDER(byte[] aesIV)
Creates a value of ASN.1 type ContentEncryptionAlgorithmIdentifier with a specified initialization vector pre-encoded for use in a binary encoding of a value of this type using the Distinguished Encoding Rules (DER) of ASN.1.

Parameters:
aesIV - a 16 byte AES initialization vector, a value of ASN.1 type AES-IV
Returns:
a value of ASN.1 type ContentEncryptionAlgorithmIdentifier for the 128-bit AES CBC mode cipher suitable for DER encoding
Throws:
java.lang.IllegalArgumentException

XCMS Toolkit


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