Package ca.carleton.gcrc.security.ber

Examples of ca.carleton.gcrc.security.ber.BerInteger


    berBytes.setValue(bytes);
    return berBytes;
  }

  private static BerInteger decodeInteger(BerTag tag, byte[] bytes, BerImplementation impl) {
    BerInteger berInt = impl.createInteger(tag.getTypeClass(), tag.getType());
   
    long value = 0;
    for(int loop=0; loop<bytes.length; ++loop) {
      int byteValue = bytes[loop];
      if( byteValue < 0 ) {
        byteValue += 256;
      }
      value = (value << 8) + byteValue;
    }
   
    Long intValue = new Long(value);
    berInt.setValue(intValue);
   
    return berInt;
  }
View Full Code Here


    if( obj instanceof BerBytes ) {
      BerBytes berBytes = (BerBytes)obj;
      value = berBytes.getValue();

    } else if( obj instanceof BerInteger ) {
      BerInteger berInt = (BerInteger)obj;
      value = computeIntegerValue(berInt);

    } else if( obj instanceof BerString ) {
      BerString berStr = (BerString)obj;
      value = computeStringValue(berStr);
View Full Code Here

    email.setValue(emailAddress);
    outer.add(email);
   
    long expiryMs = expiry.getTime();
    Long expiryLong = new Long(expiryMs);
    BerInteger date = factory.createInteger();
    date.setValue( expiryLong );
    outer.add(date);

    BerString berVersion = factory.createUTF8String();
    berVersion.setValue(version);
    outer.add(berVersion);
View Full Code Here

    email.setValue(emailAddress);
    outer.add(email);
   
    long expiryMs = expiry.getTime();
    Long expiryLong = new Long(expiryMs);
    BerInteger date = factory.createInteger();
    date.setValue( expiryLong );
    outer.add(date);
   
    byte[] result = BerEncoder.encode(outer);
    return result;
  }
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.security.ber.BerInteger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.