Package org.nasutekds.server.protocols.asn1

Examples of org.nasutekds.server.protocols.asn1.ASN1


        BindResponseProtocolOp invalidSyntaxResp =
            new BindResponseProtocolOp(invalidSyntaxCode.getIntValue(),
                                                              message);

        ByteStringBuilder saslOkBuilder = new ByteStringBuilder();
        ASN1Writer saslOkWriter = ASN1.getWriter(saslOkBuilder);
        ByteStringBuilder busyBuilder = new ByteStringBuilder();
        ASN1Writer busyWriter = ASN1.getWriter(busyBuilder);
        ByteStringBuilder invalidSyntaxBuilder = new ByteStringBuilder();
        ASN1Writer invalidSyntaxWriter = ASN1.getWriter(invalidSyntaxBuilder);

        saslOkResp.write(saslOkWriter);
        busyResp.write(busyWriter);
        invalidSyntaxResp.write(invalidSyntaxWriter);
View Full Code Here


   */
  @Test(expectedExceptions = LDAPException.class)
  public void testDecodeEmptyElement() throws Exception
  {
    ByteStringBuilder builder = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(builder);
    writer.writeStartSequence(OP_TYPE_ADD_REQUEST);
    writer.writeEndSequence();

    ASN1Reader reader = ASN1.getReader(builder.toByteString());
    LDAPReader.readProtocolOp(reader);
  }
View Full Code Here

   */
  @Test(expectedExceptions = LDAPException.class)
  public void testDecodeInvalidElement() throws Exception
  {
    ByteStringBuilder builder = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(builder);
    writer.writeStartSequence(OP_TYPE_ADD_REQUEST);
    writer.writeStartSequence();
    writer.writeEndSequence();
    writer.writeOctetString(dn);
    writer.writeEndSequence();

    ASN1Reader reader = ASN1.getReader(builder.toByteString());
    LDAPReader.readProtocolOp(reader);
  }
View Full Code Here

    w.writeMessage(message);


    // Create a cancel request and send it to the server.
    ByteStringBuilder builder = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(builder);
    writer.writeStartSequence();
    writer.writeInteger(2);
    writer.writeEndSequence();
    ExtendedRequestProtocolOp extendedRequest =
         new ExtendedRequestProtocolOp(OID_CANCEL_REQUEST,
             builder.toByteString());
    message = new LDAPMessage(3, extendedRequest);
    w.writeMessage(message);
View Full Code Here

   */
  @Test(expectedExceptions = LDAPException.class)
  public void testDecodeWrongElementType() throws Exception
  {
    ByteStringBuilder builder = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(builder);
    writer.writeStartSequence(OP_TYPE_ADD_RESPONSE);
    writer.writeOctetString(dn);
    writer.writeStartSequence();
    writer.writeEndSequence();
    writer.writeEndSequence();

    ASN1Reader reader = ASN1.getReader(builder.toByteString());
    LDAPReader.readProtocolOp(reader);
  }
View Full Code Here

    w.writeMessage(message);


    // Create a cancel request and send it to the server.
    ByteStringBuilder builder = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(builder);
    writer.writeStartSequence();
    writer.writeInteger(2);
    writer.writeEndSequence();
    ExtendedRequestProtocolOp extendedRequest =
         new ExtendedRequestProtocolOp(OID_CANCEL_REQUEST,
             builder.toByteString());
    message = new LDAPMessage(3, extendedRequest);
    w.writeMessage(message);
View Full Code Here

   */
  @Test(expectedExceptions = Exception.class)
  public void testNullEncodeDecode() throws Exception
  {
    ByteStringBuilder builder = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(builder);
    AddRequestProtocolOp addEncoded;
    AddRequestProtocolOp addDecoded;

    addEncoded = new AddRequestProtocolOp(null, null);
    addEncoded.write(writer);
View Full Code Here

   */
  @Test
  public void testEncodeDecode() throws Exception
  {
    ByteStringBuilder builder = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(builder);
    AddRequestProtocolOp addEncoded;
    AddRequestProtocolOp addDecoded;
    ArrayList<RawAttribute> attributes;


View Full Code Here

    w.writeMessage(message);


    // Create a cancel request and send it to the server.
    ByteStringBuilder builder = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(builder);
    writer.writeStartSequence();
    writer.writeInteger(2);
    writer.writeEndSequence();
    ExtendedRequestProtocolOp extendedRequest =
         new ExtendedRequestProtocolOp(OID_CANCEL_REQUEST,
             builder.toByteString());
    message = new LDAPMessage(3, extendedRequest);
    w.writeMessage(message);
View Full Code Here

    w.writeMessage(message);


    // Create a cancel request and send it to the server.
    ByteStringBuilder builder = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(builder);
    writer.writeStartSequence();
    writer.writeInteger(2);
    writer.writeEndSequence();
    ExtendedRequestProtocolOp extendedRequest =
         new ExtendedRequestProtocolOp(OID_CANCEL_REQUEST,
             builder.toByteString());
    message = new LDAPMessage(3, extendedRequest);
    w.writeMessage(message);
View Full Code Here

TOP

Related Classes of org.nasutekds.server.protocols.asn1.ASN1

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.