Examples of BERInteger


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

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

    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

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

    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

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

    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

Examples of netscape.ldap.ber.stream.BERInteger

                        // inChoice = null;
                        return choice;
                    } else {
                        // Must be time before expiry
                        return new BERInteger(stream, bytesRead);
                    }
                } else if (tag == 1) {
                    // Either the graceLogins or the error enumeration.
                    if (inChoice == null) {
                        // The enumeration
                        setInChoice(false);

                        return new BEREnumerated(stream, bytesRead);
                    } else {
                        if (inChoice.booleanValue()) {
                            // graceLogins
                            return new BERInteger(stream, bytesRead);
                        }
                    }
                }

                throw new DataRetrievalFailureException("Unexpected tag " + tag);
View Full Code Here

Examples of netscape.ldap.ber.stream.BERInteger

                        // inChoice = null;
                        return choice;
                    } else {
                        // Must be time before expiry
                        return new BERInteger(stream, bytesRead);
                    }
                } else if (tag == 1) {
                    // Either the graceLogins or the error enumeration.
                    if (inChoice == null) {
                        // The enumeration
                        setInChoice(false);

                        return new BEREnumerated(stream, bytesRead);
                    } else {
                        if (inChoice.booleanValue()) {
                            // graceLogins
                            return new BERInteger(stream, bytesRead);
                        }
                    }
                }

                throw new DataRetrievalFailureException("Unexpected tag " + tag);
View Full Code Here

Examples of org.hxzon.asn1.core.type.BerInteger

            break;
        case Tag.UNIVERSAL | Tag.IA5STRING:
            node = new BerIA5String();
            break;
        case Tag.UNIVERSAL | Tag.INTEGER:
            node = new BerInteger();
            break;
        case Tag.UNIVERSAL | Tag.NULL:
            node = new BerNull();
            break;
        case Tag.UNIVERSAL | Tag.NUMERICSTRING:
View Full Code Here

Examples of org.hxzon.asn1.core.type.BerInteger

//  public static BerNode createBerUnsigned(String name, String display, int tag, BerInputStream stream) {
//    return new BerInteger().init(name, display, tag, stream);
//  }

    public static BerNode createBerUnsignedX(String name, String display, int tag, BerInputStream stream) {
        return new BerInteger().limitBitLength(64, true).init(name, display, tag, stream);
    }
View Full Code Here

Examples of org.hxzon.asn1.core.type.BerInteger

    public static BerNode createBerUnsignedX(String name, String display, int tag, BerInputStream stream) {
        return new BerInteger().limitBitLength(64, true).init(name, display, tag, stream);
    }

    public static BerNode createBerUnsigned8(String name, String display, int tag, BerInputStream stream) {
        return new BerInteger().limitBitLength(8, true).init(name, display, tag, stream);
    }
View Full Code Here

Examples of org.hxzon.asn1.core.type.BerInteger

    public static BerNode createBerUnsigned8(String name, String display, int tag, BerInputStream stream) {
        return new BerInteger().limitBitLength(8, true).init(name, display, tag, stream);
    }

    public static BerNode createBerUnsigned16(String name, String display, int tag, BerInputStream stream) {
        return new BerInteger().limitBitLength(16, true).init(name, display, tag, stream);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.