org.exoplatform.services.security.sso.spnego.message
Class AbstractMessagePart

java.lang.Object
  extended by org.exoplatform.services.security.sso.spnego.message.AbstractMessagePart
All Implemented Interfaces:
MessagePart
Direct Known Subclasses:
AbstractSequence, ApplicationConstructedObject, ContextFlags, NegResult, NegTokenSequencePart, OctetString, Oid

public abstract class AbstractMessagePart
extends Object
implements MessagePart

Author:
Martin Algesten

Field Summary
 
Fields inherited from interface org.exoplatform.services.security.sso.spnego.message.MessagePart
TYPE_APPLICATION_CONSTRUCTED_OBJECT, TYPE_BIT_STRING, TYPE_ENUMERATED, TYPE_NEG_TOKEN_INIT, TYPE_NEG_TOKEN_TARG, TYPE_OCTET_STRING, TYPE_OID, TYPE_SEQUENCE
 
Constructor Summary
AbstractMessagePart()
           
 
Method Summary
static void arraycopy(byte[] src, int srcPos, int[] dest, int destPos, int length)
           
static void arraycopy(int[] src, int srcPos, byte[] dest, int destPos, int length)
           
protected  int[] calculateDerLength(int length)
          Calculates the ASN.1 DER represenation of the length given.
protected  int[] wrap(int derType, int[] wrappedData)
          Creates a der part of a message with the type first, then der length and then the actual data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exoplatform.services.security.sso.spnego.message.MessagePart
getDerType, parse, toDer
 

Constructor Detail

AbstractMessagePart

public AbstractMessagePart()
Method Detail

calculateDerLength

protected int[] calculateDerLength(int length)
Calculates the ASN.1 DER represenation of the length given.

Parameters:
length - the length.
Returns:
if length < 0x80, the length straight off. If more than 0x80, the first byte is 0x80 | [number of bytes required to represent length] and then bytes high byte first.

wrap

protected int[] wrap(int derType,
                     int[] wrappedData)
Creates a der part of a message with the type first, then der length and then the actual data.

Parameters:
derType - the byte identifier of the data type.
wrappedData - the data.
Returns:
[derType][derLength][data]

arraycopy

public static void arraycopy(byte[] src,
                             int srcPos,
                             int[] dest,
                             int destPos,
                             int length)
Parameters:
src - the source bytes.
srcPos - the start position in source.
dest - the destination.
destPos - the start position in destination.
length - how many bytes must be copy.

arraycopy

public static void arraycopy(int[] src,
                             int srcPos,
                             byte[] dest,
                             int destPos,
                             int length)
Parameters:
src - the source bytes.
srcPos - the start position in source.
dest - the destination.
destPos - the start position in destination.
length - how many bytes must be copy.


Copyright © 2009 eXo Platform SAS. All Rights Reserved.