Author: adc
Date: Mon Sep 13 08:49:12 2004
New Revision: 45982
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/Encoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/EncoderException.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/EncodingFactory.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/EncodingFactoryDefault.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1BMPString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1BitString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1GeneralString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1GraphicString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1IA5String.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1NumericString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1ObjectIdentifier.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1OctetString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1PrintableString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1SequenceOf.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1TeletexString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1TypeFlag.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1UniversalString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1VideotexString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1VisibleString.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/ldap/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ContextFlags.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechType.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechTypeList.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenInit.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenTarg.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegotiationToken.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/ContextFlagsDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/ContextFlagsEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeListDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeListEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenInitDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenInitEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenTargDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenTargEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegotiationTokenDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegotiationTokenEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/ContextFlagsDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/ContextFlagsEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeListDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeListEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenInitDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenInitEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenTargDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenTargEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegotiationTokenDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegotiationTokenEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/ContextFlagsDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/ContextFlagsEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeListDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeListEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenInitDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenInitEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenTargDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenTargEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegotiationTokenDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegotiationTokenEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/ContextFlagsDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/ContextFlagsEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeListDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeListEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenInitDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenInitEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenTargDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenTargEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegotiationTokenDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegotiationTokenEncoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/ContextFlagsType.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/MechTypeListType.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/MechTypeType.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/NegTokenInitType.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/NegTokenTargType.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/NegotiationTokenType.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/EncodingFactoryTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BenchmarkTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/cer/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/der/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/per/
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/runtime/ASN1ObjectIdentifierTest.java
Removed:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERTestDecoder.java
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/compiler/snickers-compiler.iml
incubator/directory/snickers/branches/ber-decoder/modules/runtime/snickers-runtime.iml
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/der/DERDecoder.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1Type.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCase.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCaseTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERDecoderTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/ConstructedTLVTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/LengthTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteLengthTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteTagTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SimplePrimitiveTLVTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteLengthTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteTagTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TagTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TupleTest.java
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TypeClassTest.java
Log:
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/compiler/snickers-compiler.iml
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/compiler/snickers-compiler.iml
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/compiler/snickers-compiler.iml
Mon Sep 13 08:49:12 2004
@@ -37,6 +37,15 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$APPLICATION_HOME_DIR$/plugins/clover-idea4.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/snickers-runtime.iml
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/snickers-runtime.iml
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/snickers-runtime.iml
Mon Sep 13 08:49:12 2004
@@ -32,6 +32,7 @@
</library>
</orderEntry>
<orderEntry type="library" name="commons-lang" level="application" />
+ <orderEntry type="module" module-name="snacc4j" />
<orderEntryProperties />
</component>
</module>
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/Encoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/Encoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,37 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.encoding;
+
+import java.io.OutputStream;
+
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public interface Encoder
+{
+ /**
+ * Encode an ASN1 object onto the output stream.
+ *
+ * @param stream the stream that is to receive the encoded ASN1 object.
+ * @param object the ASN1 object to be encoded
+ * @throws EncoderException if an error occurs during encoding
+ */
+ public void encode( OutputStream stream, ASN1Type object ) throws
EncoderException;
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/EncoderException.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/EncoderException.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,44 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.encoding;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class EncoderException extends Exception
+{
+ public EncoderException()
+ {
+ super();
+ }
+
+ public EncoderException( String message )
+ {
+ super( message );
+ }
+
+ public EncoderException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+ public EncoderException( Throwable cause )
+ {
+ super( cause );
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/EncodingFactory.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/EncodingFactory.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,102 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.encoding;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+abstract public class EncodingFactory
+{
+ private static Logger log = Logger.getLogger( EncodingFactory.class );
+ private static Map factories = new HashMap();
+ private static Map encoders = new HashMap();
+ private static Map decoders = new HashMap();
+
+
+ abstract public String getEncoding();
+
+ abstract protected Encoder obtainEncoder( Class type );
+
+ abstract protected Decoder obtainDecoder( Class type );
+
+ static public Encoder getEncoder( String encoding, Class type )
+ {
+ if ( log.isDebugEnabled() ) log.debug( "Looking for encoder for " +
encoding );
+
+ Map map = (Map) encoders.get( encoding );
+ if ( map == null )
+ {
+ map = new HashMap();
+ encoders.put( encoding, map );
+ }
+
+ Encoder result = (Encoder) map.get( type );
+ if ( result == null )
+ {
+ EncodingFactory factory = (EncodingFactory) factories.get(
encoding );
+
+ if ( factory != null )
+ {
+ result = factory.obtainEncoder( type );
+ map.put( type, result );
+ }
+ }
+
+ if ( log.isDebugEnabled() && result != null ) log.debug( "Found
encoder for " + encoding );
+ return result;
+ }
+
+ static public Decoder getDecoder( String encoding, Class type )
+ {
+ if ( log.isDebugEnabled() ) log.debug( "Looking for decoder for " +
encoding );
+
+ Map map = (Map) decoders.get( encoding );
+ if ( map == null )
+ {
+ map = new HashMap();
+ decoders.put( encoding, map );
+ }
+
+ Decoder result = (Decoder) map.get( type );
+ if ( result == null )
+ {
+ EncodingFactory factory = (EncodingFactory) factories.get(
encoding );
+
+ if ( factory != null )
+ {
+ result = factory.obtainDecoder( type );
+ map.put( type, result );
+ }
+ }
+
+ if ( log.isDebugEnabled() && result != null ) log.debug( "Found
decoder for " + encoding );
+ return result;
+ }
+
+ static public void register( EncodingFactory factory )
+ {
+ factories.put( factory.getEncoding(), factory );
+ if ( encoders.containsKey( factory.getEncoding() ) ) ( (Map)
encoders.get( factory.getEncoding() ) ).clear();
+ if ( decoders.containsKey( factory.getEncoding() ) ) ( (Map)
decoders.get( factory.getEncoding() ) ).clear();
+ if ( log.isInfoEnabled() ) log.info( "Registered encoding factory for
" + factory.getEncoding() );
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/EncodingFactoryDefault.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/EncodingFactoryDefault.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,72 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.encoding;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class EncodingFactoryDefault extends EncodingFactory
+{
+ private final String encoding;
+
+ public EncodingFactoryDefault( String encoding )
+ {
+ this.encoding = encoding;
+ }
+
+ public String getEncoding()
+ {
+ return encoding;
+ }
+
+ protected Encoder obtainEncoder( Class type )
+ {
+ return (Encoder) allocate( type, "Encoder" );
+ }
+
+ protected Decoder obtainDecoder( Class type )
+ {
+ return (Decoder) allocate( type, "Decoder" );
+ }
+
+ private Object allocate( Class type, String encodingType )
+ {
+ Object encoder = null;
+ String name = type.getName();
+ String pkg = type.getPackage().getName() + "." + encoding + "." +
name.substring( name.lastIndexOf( "." ) + 1 ) + encodingType;
+ try
+ {
+ Class encoderClass =
Thread.currentThread().getContextClassLoader().loadClass( pkg );
+ encoder = encoderClass.newInstance();
+ }
+ catch ( ClassNotFoundException e )
+ {
+ // DO NOTHING
+ }
+ catch ( IllegalAccessException e )
+ {
+ // DO NOTHING
+ }
+ catch ( InstantiationException e )
+ {
+ // DO NOTHING
+ }
+
+ return encoder;
+ }
+}
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/der/DERDecoder.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/der/DERDecoder.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/encoding/der/DERDecoder.java
Mon Sep 13 08:49:12 2004
@@ -16,7 +16,7 @@
*/
package org.apache.snickers.encoding.der;
-import org.apache.snickers.encoding.ber.BERDecoder;
+import org.apache.snickers.encoding.ber.AOKDecoder;
/**
@@ -26,8 +26,8 @@
* <code>BERDecoder</code>.
*
* @version $Revision: $ $Date: $
- * @see BERDecoder
+ * @see AOKDecoder
*/
-public class DERDecoder extends BERDecoder
+public class DERDecoder extends AOKDecoder
{
}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1BMPString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1BMPString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1BMPString implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return false; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1BitString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1BitString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,31 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+import java.util.BitSet;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1BitString extends BitSet implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return false; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1GeneralString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1GeneralString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1GeneralString implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return false; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1GraphicString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1GraphicString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1GraphicString implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return false; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1IA5String.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1IA5String.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1IA5String implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return false; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1NumericString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1NumericString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1NumericString implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return false; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1ObjectIdentifier.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1ObjectIdentifier.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,71 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+import java.util.StringTokenizer;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1ObjectIdentifier implements ASN1Type
+{
+ private int id[];
+
+ public ASN1ObjectIdentifier( ASN1ObjectIdentifier oid )
+ {
+ this.id = oid.id;
+ }
+
+ public ASN1ObjectIdentifier( String oid )
+ {
+ StringTokenizer tokenizer = new StringTokenizer( oid, "." );
+ this.id = new int[tokenizer.countTokens()];
+ for ( int i = 0; tokenizer.hasMoreTokens(); i++ )
+ {
+ id[i] = Integer.parseInt( tokenizer.nextToken() );
+ }
+ }
+
+ public ASN1ObjectIdentifier( int id[] )
+ {
+ this.id = new int[id.length];
+ System.arraycopy( id, 0, this.id, 0, id.length );
+ }
+
+ public ASN1ObjectIdentifier( ASN1ObjectIdentifier oid, int id[] )
+ {
+ this.id = new int[oid.id.length + id.length];
+ System.arraycopy( oid.id, 0, this.id, 0, oid.id.length );
+ System.arraycopy( id, 0, this.id, oid.id.length, id.length );
+ }
+
+ public int getId( int index )
+ {
+ return id[index];
+ }
+
+ public int size()
+ {
+ return id.length;
+ }
+
+ public boolean isConsistent()
+ {
+ return true;
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1OctetString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1OctetString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,40 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1OctetString implements ASN1Type
+{
+ private byte[] octetString;
+
+ public ASN1OctetString( byte[] octetString )
+ {
+ this.octetString = octetString;
+ }
+
+ public byte[] getOctetString()
+ {
+ return octetString;
+ }
+
+ public boolean isConsistent()
+ {
+ return true;
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1PrintableString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1PrintableString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1PrintableString implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return false; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1SequenceOf.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1SequenceOf.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,125 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+abstract public class ASN1SequenceOf extends LinkedList implements ASN1Type
+{
+ abstract protected boolean instanceOf( Object o );
+
+ /**
+ * Ensures that this collection contains the specified element (optional
+ * operation). Returns <tt>true</tt> if this collection changed as a
+ * result of the call. (Returns <tt>false</tt> if this collection does
+ * not permit duplicates and already contains the specified element.)<p>
+ * <p/>
+ * Collections that support this operation may place limitations on what
+ * elements may be added to this collection. In particular, some
+ * collections will refuse to add <tt>null</tt> elements, and others will
+ * impose restrictions on the type of elements that may be added.
+ * Collection classes should clearly specify in their documentation any
+ * restrictions on what elements may be added.<p>
+ * <p/>
+ * If a collection refuses to add a particular element for any reason
+ * other than that it already contains the element, it <i>must</i> throw
+ * an exception (rather than returning <tt>false</tt>). This preserves
+ * the invariant that a collection always contains the specified element
+ * after this call returns.
+ *
+ * @param o element whose presence in this collection is to be ensured.
+ * @return <tt>true</tt> if this collection changed as a result of the
+ * call
+ * @throws UnsupportedOperationException <tt>add</tt> is not supported by
+ * this collection.
+ * @throws ClassCastException class of the specified element
prevents it
+ * from being added to this
collection.
+ * @throws NullPointerException if the specified element is null
and this
+ * collection does not support null
elements.
+ * @throws IllegalArgumentException some aspect of this element
prevents
+ * it from being added to this
collection.
+ */
+ public boolean add( Object o )
+ {
+ if ( !instanceOf( o ) ) throw new IllegalArgumentException( "Not a
valid instance" );
+ return super.add( o );
+ }
+
+ /**
+ * Removes a single instance of the specified element from this
+ * collection, if it is present (optional operation). More formally,
+ * removes an element <tt>e</tt> such that <tt>(o==null ? e==null :
+ * o.equals(e))</tt>, if this collection contains one or more such
+ * elements. Returns true if this collection contained the specified
+ * element (or equivalently, if this collection changed as a result of the
+ * call).
+ *
+ * @param o element to be removed from this collection, if present.
+ * @return <tt>true</tt> if this collection changed as a result of the
+ * call
+ * @throws ClassCastException if the type of the specified
element
+ * is incompatible with this
collection (optional).
+ * @throws NullPointerException if the specified element is null
and this
+ * collection does not support null
elements (optional).
+ * @throws UnsupportedOperationException remove is not supported by this
+ * collection.
+ */
+ public boolean remove( Object o )
+ {
+ if ( !instanceOf( o ) ) throw new IllegalArgumentException( "Not a
valid instance" );
+ return super.add( o );
+ }
+
+ /**
+ * Adds all of the elements in the specified collection to this collection
+ * (optional operation). The behavior of this operation is undefined if
+ * the specified collection is modified while the operation is in progress.
+ * (This implies that the behavior of this call is undefined if the
+ * specified collection is this collection, and this collection is
+ * nonempty.)
+ *
+ * @param c elements to be inserted into this collection.
+ * @return <tt>true</tt> if this collection changed as a result of the
+ * call
+ * @throws UnsupportedOperationException if this collection does not
+ * support the <tt>addAll</tt>
method.
+ * @throws ClassCastException if the class of an element of the
specified
+ * collection prevents it from being
added to this collection.
+ * @throws NullPointerException if the specified collection
contains one
+ * or more null elements and this
collection does not support null
+ * elements, or if the specified
collection is <tt>null</tt>.
+ * @throws IllegalArgumentException some aspect of an element of the
+ * specified collection prevents it
from being added to this
+ * collection.
+ * @see #add(Object)
+ */
+ public boolean addAll( Collection c )
+ {
+ Iterator iter = c.iterator();
+ while ( iter.hasNext() )
+ {
+ if ( !instanceOf( iter.next() ) ) throw new
IllegalArgumentException( "Not a valid instance" );
+ }
+ return super.addAll( c );
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1TeletexString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1TeletexString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1TeletexString implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return true;
+ }
+}
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1Type.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1Type.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1Type.java
Mon Sep 13 08:49:12 2004
@@ -21,4 +21,11 @@
*/
public interface ASN1Type
{
+ /**
+ * A method used to see if the POJO is consistent with its ASN1 definition.
+ *
+ * @return <code>true</code> if the POJO is consistent with its ASN1
+ * definition and <code>false</code> otherwise.
+ */
+ public boolean isConsistent();
}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1TypeFlag.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1TypeFlag.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,26 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+/**
+ * Used by encoders/decoders for the encoding of sub-typed types
+ *
+ * @version $Revision: $ $Date: $
+ */
+public interface ASN1TypeFlag
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1UniversalString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1UniversalString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1UniversalString implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return true;
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1VideotexString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1VideotexString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1VideotexString implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return true;
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1VisibleString.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/java/org/apache/snickers/runtime/ASN1VisibleString.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1VisibleString implements ASN1Type
+{
+ public boolean isConsistent()
+ {
+ return true;
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ContextFlags.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ContextFlags.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,34 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego;
+
+import com.acme.spnego.type.ContextFlagsType;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ContextFlags extends org.apache.snickers.runtime.ASN1BitString
implements ContextFlagsType
+{
+ public static final int delegFlag = 0;
+ public static final int mutualFlag = 1;
+ public static final int replayFlag = 2;
+ public static final int sequenceFlag = 3;
+ public static final int anonFlag = 4;
+ public static final int confFlag = 5;
+ public static final int integFlag = 6;
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechType.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechType.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,48 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego;
+
+import com.acme.spnego.type.MechTypeType;
+
+import org.apache.snickers.runtime.ASN1ObjectIdentifier;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechType extends org.apache.snickers.runtime.ASN1ObjectIdentifier
implements MechTypeType
+{
+ public MechType( String oid )
+ {
+ super( oid );
+ }
+
+ public MechType( ASN1ObjectIdentifier oid )
+ {
+ super( oid );
+ }
+
+ public MechType( int id[] )
+ {
+ super( id );
+ }
+
+ public MechType( ASN1ObjectIdentifier oid, int id[] )
+ {
+ super( oid, id );
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechTypeList.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechTypeList.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,36 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego;
+
+import com.acme.spnego.type.MechTypeListType;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeList extends org.apache.snickers.runtime.ASN1SequenceOf
implements MechTypeListType
+{
+ protected boolean instanceOf( Object o )
+ {
+ return ( o instanceof MechType );
+ }
+
+ public boolean isConsistent()
+ {
+ return true;
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenInit.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenInit.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,92 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego;
+
+import com.acme.spnego.type.NegTokenInitType;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenInit implements NegTokenInitType,
org.apache.snickers.runtime.ASN1Type
+{
+ private MechTypeList mechTypes;
+ private ContextFlags reqFlags;
+ private org.apache.snickers.runtime.ASN1OctetString mechToken;
+ private org.apache.snickers.runtime.ASN1OctetString mechListMIC;
+
+ public MechTypeList getMechTypes()
+ {
+ return mechTypes;
+ }
+
+ public void setMechTypes( MechTypeList mechTypes )
+ {
+ this.mechTypes = mechTypes;
+ }
+
+ public ContextFlags getReqFlags()
+ {
+ return reqFlags;
+ }
+
+ public void setReqFlags( ContextFlags reqFlags )
+ {
+ this.reqFlags = reqFlags;
+ }
+
+ public org.apache.snickers.runtime.ASN1OctetString getMechToken()
+ {
+ return mechToken;
+ }
+
+ public void setMechToken( org.apache.snickers.runtime.ASN1OctetString
mechToken )
+ {
+ this.mechToken = mechToken;
+ }
+
+ public org.apache.snickers.runtime.ASN1OctetString getMechListMIC()
+ {
+ return mechListMIC;
+ }
+
+ public void setMechListMIC( org.apache.snickers.runtime.ASN1OctetString
mechListMIC )
+ {
+ this.mechListMIC = mechListMIC;
+ }
+
+ public boolean isConsistent()
+ {
+ if ( mechTypes != null && !mechTypes.isConsistent() )
+ {
+ return false;
+ }
+ if ( reqFlags != null && !reqFlags.isConsistent() )
+ {
+ return false;
+ }
+ if ( mechToken != null && !mechToken.isConsistent() )
+ {
+ return false;
+ }
+ if ( mechListMIC != null && !mechListMIC.isConsistent() )
+ {
+ return false;
+ }
+ return true;
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenTarg.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenTarg.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,94 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego;
+
+import com.acme.spnego.type.NegTokenTargType;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenTarg implements NegTokenTargType,
org.apache.snickers.runtime.ASN1Type
+{
+
+ private negResultEnum negResult;
+ private MechType supportedMech;
+ private org.apache.snickers.runtime.ASN1OctetString responseToken;
+ private org.apache.snickers.runtime.ASN1OctetString mechListMIC;
+
+ public negResultEnum getNegResult()
+ {
+ return negResult;
+ }
+
+ public void setNegResult( negResultEnum negResult )
+ {
+ this.negResult = negResult;
+ }
+
+ public MechType getSupportedMech()
+ {
+ return supportedMech;
+ }
+
+ public void setSupportedMech( MechType supportedMech )
+ {
+ this.supportedMech = supportedMech;
+ }
+
+ public org.apache.snickers.runtime.ASN1OctetString getResponseToken()
+ {
+ return responseToken;
+ }
+
+ public void setResponseToken( org.apache.snickers.runtime.ASN1OctetString
responseToken )
+ {
+ this.responseToken = responseToken;
+ }
+
+ public org.apache.snickers.runtime.ASN1OctetString getMechListMIC()
+ {
+ return mechListMIC;
+ }
+
+ public void setMechListMIC( org.apache.snickers.runtime.ASN1OctetString
mechListMIC )
+ {
+ this.mechListMIC = mechListMIC;
+ }
+
+ public boolean isConsistent()
+ {
+ return false; //todo: consider this autogenerated code
+ }
+
+ public static class negResultEnum extends
org.apache.commons.lang.enum.ValuedEnum implements
org.apache.snickers.runtime.ASN1Type
+ {
+ public static final negResultEnum ACCEPTCOMPLETED = new negResultEnum(
"accept_completed", 0 );
+ public static final negResultEnum ACCEPTINCOMPLETE = new
negResultEnum( "accept_incomplete", 1 );
+ public static final negResultEnum REJECT = new negResultEnum(
"reject", 2 );
+
+ protected negResultEnum( String s, int i )
+ {
+ super( s, i );
+ }
+
+ public boolean isConsistent()
+ {
+ return true;
+ }
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegotiationToken.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegotiationToken.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,68 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego;
+
+import com.acme.spnego.type.NegotiationTokenType;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegotiationToken implements NegotiationTokenType,
org.apache.snickers.runtime.ASN1Type
+{
+ private NegTokenInit negTokenInit;
+ private NegTokenTarg negTokenTarg;
+
+ public NegTokenInit getNegTokenInit()
+ {
+ return negTokenInit;
+ }
+
+ public void setNegTokenInit( NegTokenInit negTokenInit )
+ {
+ this.negTokenInit = negTokenInit;
+ }
+
+ public NegTokenTarg getNegTokenTarg()
+ {
+ return negTokenTarg;
+ }
+
+ public void setNegTokenTarg( NegTokenTarg negTokenTarg )
+ {
+ this.negTokenTarg = negTokenTarg;
+ }
+
+ public boolean isConsistent()
+ {
+ if ( !( ( negTokenInit != null ) ^ ( negTokenTarg != null ) ) )
+ {
+ return false;
+ }
+
+ if ( negTokenInit != null )
+ {
+ return negTokenInit.isConsistent();
+ }
+ if ( negTokenTarg != null )
+ {
+ return negTokenTarg.isConsistent();
+ }
+
+ return true;
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/ContextFlagsDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/ContextFlagsDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,34 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import java.io.InputStream;
+
+import org.apache.snickers.encoding.Decoder;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ContextFlagsDecoder implements Decoder
+{
+ public ASN1Type decode( InputStream stream )
+ {
+ return null; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/ContextFlagsEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/ContextFlagsEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,46 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import java.io.OutputStream;
+
+import org.apache.snickers.encoding.EncoderException;
+import org.apache.snickers.encoding.ber.BEREncoder;
+import org.apache.snickers.encoding.ber.BEROutputStream;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ContextFlagsEncoder implements BEREncoder
+{
+ public void encode( BEROutputStream stream, ASN1Type object ) throws
EncoderException
+ {
+ //todo: consider this autogenerated code
+ }
+
+ public void encode( OutputStream stream, ASN1Type object ) throws
EncoderException
+ {
+ //todo: consider this autogenerated code
+ }
+
+ public int length( int tagNumber, ASN1Type object ) throws EncoderException
+ {
+ return 0; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,34 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import java.io.InputStream;
+
+import org.apache.snickers.encoding.Decoder;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeDecoder implements Decoder
+{
+ public ASN1Type decode( InputStream stream )
+ {
+ return null; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,66 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import java.io.OutputStream;
+
+import org.apache.snickers.encoding.ber.BEREncoder;
+import org.apache.snickers.encoding.ber.BEROutputStream;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeEncoder implements BEREncoder
+{
+ protected org.apache.snickers.encoding.ber.BEREncoder encoder;
+
+ public MechTypeEncoder()
+ {
+ encoder = new
org.apache.snickers.encoding.ber.ASN1ObjectIdentifierEncoder();
+ }
+
+ public void encode( OutputStream stream, ASN1Type object ) throws
org.apache.snickers.encoding.EncoderException
+ {
+ if ( !( object instanceof
org.apache.snickers.runtime.ASN1ObjectIdentifier ) )
+ {
+ throw new org.apache.snickers.encoding.EncoderException( "Object
not instance of org.apache.snickers.runtime.ASN1ObjectIdentifier" );
+ }
+
+ org.apache.snickers.runtime.ASN1ObjectIdentifier oid =
(org.apache.snickers.runtime.ASN1ObjectIdentifier) object;
+
+ if ( !oid.isConsistent() )
+ {
+ throw new org.apache.snickers.encoding.EncoderException(
"org.apache.snickers.runtime.ASN1ObjectIdentifier is not consistent." );
+ }
+
+ encode( new org.apache.snickers.encoding.ber.BEROutputStream( stream
), object );
+ }
+
+ public int length( int tagNumber, ASN1Type object ) throws
org.apache.snickers.encoding.EncoderException
+ {
+ return encoder.length( tagNumber, object );
+ }
+
+ public void encode( BEROutputStream out, ASN1Type object ) throws
org.apache.snickers.encoding.EncoderException
+ {
+ org.apache.snickers.runtime.ASN1ObjectIdentifier oid =
(org.apache.snickers.runtime.ASN1ObjectIdentifier) object;
+
+ encoder.encode( out, oid );
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeListDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeListDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,34 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import java.io.InputStream;
+
+import org.apache.snickers.encoding.Decoder;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeListDecoder implements Decoder
+{
+ public ASN1Type decode( InputStream stream )
+ {
+ return null; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeListEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/MechTypeListEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,99 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import com.acme.spnego.MechTypeList;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeListEncoder implements
org.apache.snickers.encoding.ber.BEREncoder
+{
+ protected org.apache.snickers.encoding.ber.BEREncoder mechTypeEncoder;
+
+ public MechTypeListEncoder()
+ {
+ mechTypeEncoder = new MechTypeEncoder();
+ }
+
+ public void encode( java.io.OutputStream stream,
org.apache.snickers.runtime.ASN1Type object ) throws
org.apache.snickers.encoding.EncoderException
+ {
+ if ( !( object instanceof MechTypeList ) )
+ {
+ throw new org.apache.snickers.encoding.EncoderException( "Object
not instance of MechTypeList" );
+ }
+
+ MechTypeList mechTypeList = (MechTypeList) object;
+
+ if ( !mechTypeList.isConsistent() )
+ {
+ throw new org.apache.snickers.encoding.EncoderException(
"MechTypeList is not consistent." );
+ }
+
+ encode( new org.apache.snickers.encoding.ber.BEROutputStream( stream
), object );
+ }
+
+ public int length( int tagNumber, org.apache.snickers.runtime.ASN1Type
object ) throws org.apache.snickers.encoding.EncoderException
+ {
+ MechTypeList mechTypeList = (MechTypeList) object;
+
+ int length = 0;
+
+ length = org.apache.snickers.encoding.ber.Util.calculateLength(
tagNumber, contentLength( -1, mechTypeList ) );
+
+ return length;
+ }
+
+ public void encode( org.apache.snickers.encoding.ber.BEROutputStream out,
org.apache.snickers.runtime.ASN1Type object ) throws
org.apache.snickers.encoding.EncoderException
+ {
+ MechTypeList mechTypeList = (MechTypeList) object;
+
+ try
+ {
+ out.encodeExplicit(
org.apache.snickers.encoding.ber.TypeClass.UNIVERSAL, false, 16 );
+ out.encodeLengthBegin( contentLength( 16, mechTypeList ) );
+
+ java.util.Iterator iter = mechTypeList.iterator();
+ while ( iter.hasNext() )
+ {
+ mechTypeEncoder.encode( out,
(org.apache.snickers.runtime.ASN1Type) iter.next() );
+
+ }
+
+ out.encodeLengthEnd();
+ }
+ catch ( java.io.IOException ioe )
+ {
+ throw new org.apache.snickers.encoding.EncoderException( ioe );
+ }
+ }
+
+ protected int contentLength( int tagNumber, MechTypeList mechTypeList )
throws org.apache.snickers.encoding.EncoderException
+ {
+ int length = 0;
+
+ java.util.Iterator iter = mechTypeList.iterator();
+ while ( iter.hasNext() )
+ {
+ length = org.apache.snickers.encoding.ber.Util.incrementLength(
length, mechTypeEncoder.length( -1, (org.apache.snickers.runtime.ASN1Type)
iter.next() ) );
+ }
+
+ return length;
+ }
+}
+
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenInitDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenInitDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,34 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenInitDecoder implements
org.apache.snickers.encoding.ber.BERDecoder
+{
+ public org.apache.snickers.runtime.ASN1Type decode( java.io.InputStream
stream ) throws org.apache.snickers.encoding.DecoderException
+ {
+ return null; //todo: consider this autogenerated code
+ }
+
+ public org.apache.snickers.runtime.ASN1Type decode(
org.apache.snickers.encoding.ber.BERInputStream stream ) throws
org.apache.snickers.encoding.DecoderException
+ {
+ return null; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenInitEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenInitEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,138 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import com.acme.spnego.NegTokenInit;
+import com.acme.spnego.type.NegTokenInitType;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenInitEncoder implements
org.apache.snickers.encoding.ber.BEREncoder
+{
+ protected org.apache.snickers.encoding.ber.BEREncoder mechTypesEncoder;
+ protected org.apache.snickers.encoding.ber.BEREncoder reqFlagsEncoder;
+ protected org.apache.snickers.encoding.ber.BEREncoder mechTokenEncoder;
+ protected org.apache.snickers.encoding.ber.BEREncoder mechListMICEncoder;
+
+ public NegTokenInitEncoder()
+ {
+ mechTypesEncoder = new MechTypeListEncoder();
+ reqFlagsEncoder = new ContextFlagsEncoder();
+ mechTokenEncoder = new
org.apache.snickers.encoding.ber.ASN1OctetStringEncoder();
+ mechListMICEncoder = new
org.apache.snickers.encoding.ber.ASN1OctetStringEncoder();
+ }
+
+ public void encode( java.io.OutputStream stream,
org.apache.snickers.runtime.ASN1Type object ) throws
org.apache.snickers.encoding.EncoderException
+ {
+ if ( !( object instanceof NegTokenInitType ) )
+ {
+ throw new org.apache.snickers.encoding.EncoderException( "Object
not instance of NegTokenInitType" );
+ }
+
+ NegTokenInit negTokenInit = (NegTokenInit) object;
+
+ if ( !negTokenInit.isConsistent() )
+ {
+ throw new org.apache.snickers.encoding.EncoderException(
"NegTokenInitType is not consistent." );
+ }
+
+ encode( new org.apache.snickers.encoding.ber.BEROutputStream( stream
), object );
+ }
+
+ public int length( int tagNumber, org.apache.snickers.runtime.ASN1Type
object ) throws org.apache.snickers.encoding.EncoderException
+ {
+ NegTokenInit negTokenInit = (NegTokenInit) object;
+
+ int length = 0;
+
+ length = org.apache.snickers.encoding.ber.Util.calculateLength(
tagNumber, contentLength( tagNumber, negTokenInit ) );
+
+ return length;
+ }
+
+ public void encode( org.apache.snickers.encoding.ber.BEROutputStream out,
org.apache.snickers.runtime.ASN1Type object ) throws
org.apache.snickers.encoding.EncoderException
+ {
+ NegTokenInit negTokenInit = (NegTokenInit) object;
+
+ try
+ {
+ out.encodeExplicit(
org.apache.snickers.encoding.ber.TypeClass.UNIVERSAL, false, 16 );
+ out.encodeLengthBegin( contentLength( 16, negTokenInit ) );
+
+ if ( negTokenInit.getMechTypes() != null )
+ {
+ out.encodeExplicit(
org.apache.snickers.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 0 );
+ out.encodeLengthBegin( mechTypesEncoder.length( 0,
negTokenInit.getMechTypes() ) );
+ mechTypesEncoder.encode( out, negTokenInit.getMechTypes() );
+ out.encodeLengthEnd();
+ }
+ if ( negTokenInit.getReqFlags() != null )
+ {
+ out.encodeExplicit(
org.apache.snickers.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 1 );
+ out.encodeLengthBegin( reqFlagsEncoder.length( 1,
negTokenInit.getReqFlags() ) );
+ reqFlagsEncoder.encode( out, negTokenInit.getReqFlags() );
+ out.encodeLengthEnd();
+ }
+ if ( negTokenInit.getMechToken() != null )
+ {
+ out.encodeExplicit(
org.apache.snickers.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 2 );
+ out.encodeLengthBegin( mechTokenEncoder.length( -1,
negTokenInit.getMechToken() ) );
+ mechTokenEncoder.encode( out, negTokenInit.getMechToken() );
+ out.encodeLengthEnd();
+ }
+ if ( negTokenInit.getMechListMIC() != null )
+ {
+ out.encodeExplicit(
org.apache.snickers.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 3 );
+ out.encodeLengthBegin( mechListMICEncoder.length( -1,
negTokenInit.getMechListMIC() ) );
+ mechListMICEncoder.encode( out, negTokenInit.getMechListMIC()
);
+ out.encodeLengthEnd();
+ }
+
+ out.encodeLengthEnd();
+ }
+ catch ( java.io.IOException ioe )
+ {
+ throw new org.apache.snickers.encoding.EncoderException( ioe );
+ }
+ }
+
+ protected int contentLength( int tagNumber, NegTokenInit negTokenInit )
throws org.apache.snickers.encoding.EncoderException
+ {
+ int length = 0;
+ if ( negTokenInit.getMechTypes() != null )
+ {
+ length = org.apache.snickers.encoding.ber.Util.incrementLength(
length, org.apache.snickers.encoding.ber.Util.calculateLength( 0,
mechTypesEncoder.length( -1, negTokenInit.getMechTypes() ) ) );
+ }
+ if ( negTokenInit.getReqFlags() != null )
+ {
+ length = org.apache.snickers.encoding.ber.Util.incrementLength(
length, org.apache.snickers.encoding.ber.Util.calculateLength( 1,
reqFlagsEncoder.length( -1, negTokenInit.getReqFlags() ) ) );
+ }
+ if ( negTokenInit.getMechToken() != null )
+ {
+ length = org.apache.snickers.encoding.ber.Util.incrementLength(
length, org.apache.snickers.encoding.ber.Util.calculateLength( 2,
mechTokenEncoder.length( -1, negTokenInit.getMechToken() ) ) );
+ }
+ if ( negTokenInit.getMechListMIC() != null )
+ {
+ length = org.apache.snickers.encoding.ber.Util.incrementLength(
length, org.apache.snickers.encoding.ber.Util.calculateLength( 3,
mechListMICEncoder.length( -1, negTokenInit.getMechListMIC() ) ) );
+ }
+
+ return length;
+ }
+}
+
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenTargDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenTargDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,35 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import java.io.InputStream;
+
+import org.apache.snickers.encoding.Decoder;
+import org.apache.snickers.encoding.ber.BERDecoder;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenTargDecoder extends BERDecoder
+{
+ public ASN1Type decode( InputStream stream )
+ {
+ return null; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenTargEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegTokenTargEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,46 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import java.io.OutputStream;
+
+import org.apache.snickers.encoding.EncoderException;
+import org.apache.snickers.encoding.ber.BEREncoder;
+import org.apache.snickers.encoding.ber.BEROutputStream;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenTargEncoder implements BEREncoder
+{
+ public void encode( OutputStream stream, ASN1Type object ) throws
EncoderException
+ {
+ //todo: consider this autogenerated code
+ }
+
+ public int length( int tagNumber, ASN1Type object ) throws EncoderException
+ {
+ return 0; //todo: consider this autogenerated code
+ }
+
+ public void encode( BEROutputStream stream, ASN1Type object ) throws
EncoderException
+ {
+ //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegotiationTokenDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegotiationTokenDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,79 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import com.acme.spnego.NegTokenInit;
+import com.acme.spnego.NegTokenTarg;
+import com.acme.spnego.NegotiationToken;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegotiationTokenDecoder implements
org.apache.snickers.encoding.ber.BERDecoder
+{
+ protected org.apache.snickers.encoding.ber.BERDecoder negTokenInitDecoder;
+ protected org.apache.snickers.encoding.ber.BERDecoder negTokenTargDecoder;
+
+ public NegotiationTokenDecoder()
+ {
+ negTokenInitDecoder = new NegTokenInitDecoder();
+ negTokenTargDecoder = new NegTokenTargDecoder();
+ }
+
+ public org.apache.snickers.runtime.ASN1Type decode( java.io.InputStream
stream ) throws org.apache.snickers.encoding.DecoderException
+ {
+ return decode( new org.apache.snickers.encoding.ber.BERInputStream(
stream ) );
+ }
+
+ public org.apache.snickers.runtime.ASN1Type decode(
org.apache.snickers.encoding.ber.BERInputStream stream ) throws
org.apache.snickers.encoding.DecoderException
+ {
+ NegotiationToken negotiationToken = new NegotiationToken();
+ org.apache.snickers.runtime.ASN1Type result = negotiationToken;
+
+ try
+ {
+ if ( stream.readTypeClass() !=
org.apache.snickers.encoding.ber.TypeClass.CONTEXT_SPECIFIC ) throw new
org.apache.snickers.encoding.DecoderException( "Invalid type class" );
+ if ( !stream.readConstructed() ) throw new
org.apache.snickers.encoding.DecoderException( "Identifier not constructed" );
+
+ int tag = stream.readTag();
+ switch ( stream.readTag() )
+ {
+ case 0:
+ {
+ negotiationToken.setNegTokenInit( (NegTokenInit)
negTokenInitDecoder.decode( stream ) );
+ break;
+ }
+ case 1:
+ {
+ negotiationToken.setNegTokenTarg( (NegTokenTarg)
negTokenTargDecoder.decode( stream ) );
+ break;
+ }
+ default:
+ {
+ throw new
org.apache.snickers.encoding.DecoderException( "Invalid TAG read: " + tag );
+ }
+ }
+ }
+ catch ( java.io.IOException ioe )
+ {
+ throw new org.apache.snickers.encoding.DecoderException( ioe );
+ }
+
+ return result;
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegotiationTokenEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/NegotiationTokenEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,107 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.ber;
+
+import com.acme.spnego.NegotiationToken;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegotiationTokenEncoder implements
org.apache.snickers.encoding.ber.BEREncoder
+{
+ protected org.apache.snickers.encoding.ber.BEREncoder negTokenInitEncoder;
+ protected org.apache.snickers.encoding.ber.BEREncoder negTokenTargEncoder;
+
+ public NegotiationTokenEncoder()
+ {
+ negTokenInitEncoder = new NegTokenInitEncoder();
+ negTokenTargEncoder = new NegTokenTargEncoder();
+ }
+
+ public void encode( java.io.OutputStream stream,
org.apache.snickers.runtime.ASN1Type object ) throws
org.apache.snickers.encoding.EncoderException
+ {
+ if ( !( object instanceof NegotiationToken ) )
+ {
+ throw new org.apache.snickers.encoding.EncoderException( "Object
not instance of NegotiationTokenType" );
+ }
+
+ NegotiationToken negotiationToken = (NegotiationToken) object;
+
+ if ( !negotiationToken.isConsistent() )
+ {
+ throw new org.apache.snickers.encoding.EncoderException(
"NegotiationToken is not consistent." );
+ }
+
+ encode( new org.apache.snickers.encoding.ber.BEROutputStream( stream
), object );
+ }
+
+ public int length( int tagNumber, org.apache.snickers.runtime.ASN1Type
object ) throws org.apache.snickers.encoding.EncoderException
+ {
+ NegotiationToken negotiationToken = (NegotiationToken) object;
+
+ int length = 0;
+
+ length = contentLength( tagNumber, negotiationToken );
+
+ return length;
+ }
+
+ public void encode( org.apache.snickers.encoding.ber.BEROutputStream out,
org.apache.snickers.runtime.ASN1Type object ) throws
org.apache.snickers.encoding.EncoderException
+ {
+ NegotiationToken negotiationToken = (NegotiationToken) object;
+
+ try
+ {
+ if ( negotiationToken.getNegTokenInit() != null )
+ {
+ out.encodeExplicit(
org.apache.snickers.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 0 );
+ out.encodeLengthBegin( negTokenInitEncoder.length( 0,
negotiationToken.getNegTokenInit() ) );
+ negTokenInitEncoder.encode( out,
negotiationToken.getNegTokenInit() );
+ out.encodeLengthEnd();
+ }
+ if ( negotiationToken.getNegTokenTarg() != null )
+ {
+ out.encodeExplicit(
org.apache.snickers.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 1 );
+ out.encodeLengthBegin( negTokenTargEncoder.length( 1,
negotiationToken.getNegTokenTarg() ) );
+ negTokenTargEncoder.encode( out,
negotiationToken.getNegTokenTarg() );
+ out.encodeLengthEnd();
+ }
+ }
+ catch ( java.io.IOException ioe )
+ {
+ throw new org.apache.snickers.encoding.EncoderException( ioe );
+ }
+ }
+
+
+ protected int contentLength( int tagNumber, NegotiationToken
negotiationToken ) throws org.apache.snickers.encoding.EncoderException
+ {
+ int length = 0;
+
+ if ( negotiationToken.getNegTokenInit() != null )
+ {
+ length = org.apache.snickers.encoding.ber.Util.incrementLength(
length, org.apache.snickers.encoding.ber.Util.calculateLength( tagNumber,
negTokenInitEncoder.length( 0, negotiationToken.getNegTokenInit() ) ) );
+ }
+ if ( negotiationToken.getNegTokenTarg() != null )
+ {
+ length = org.apache.snickers.encoding.ber.Util.incrementLength(
length, org.apache.snickers.encoding.ber.Util.calculateLength( tagNumber,
negTokenTargEncoder.length( 1, negotiationToken.getNegTokenTarg() ) ) );
+ }
+
+ return length;
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/ContextFlagsDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/ContextFlagsDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ContextFlagsDecoder extends
com.acme.spnego.ber.ContextFlagsDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/ContextFlagsEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/ContextFlagsEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ContextFlagsEncoder extends
com.acme.spnego.der.ContextFlagsDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeDecoder extends com.acme.spnego.ber.MechTypeDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeEncoder extends com.acme.spnego.der.MechTypeEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeListDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeListDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeListDecoder extends
com.acme.spnego.ber.MechTypeListDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeListEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/MechTypeListEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeListEncoder extends
com.acme.spnego.der.MechTypeListEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenInitDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenInitDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenInitDecoder extends
com.acme.spnego.ber.NegTokenInitDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenInitEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenInitEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenInitEncoder extends
com.acme.spnego.der.NegTokenInitEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenTargDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenTargDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenTargDecoder extends
com.acme.spnego.ber.NegTokenTargDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenTargEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegTokenTargEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenTargEncoder extends
com.acme.spnego.der.NegTokenTargEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegotiationTokenDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegotiationTokenDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegotiationTokenDecoder extends
com.acme.spnego.ber.NegotiationTokenDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegotiationTokenEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/NegotiationTokenEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.cer;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegotiationTokenEncoder extends
com.acme.spnego.der.NegotiationTokenEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/ContextFlagsDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/ContextFlagsDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ContextFlagsDecoder extends
com.acme.spnego.ber.ContextFlagsDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/ContextFlagsEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/ContextFlagsEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ContextFlagsEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeDecoder extends com.acme.spnego.ber.MechTypeDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeListDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeListDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeListDecoder extends
com.acme.spnego.ber.MechTypeListDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeListEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/MechTypeListEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeListEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenInitDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenInitDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenInitDecoder extends
com.acme.spnego.ber.NegTokenInitDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenInitEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenInitEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenInitEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenTargDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenTargDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenTargDecoder extends
com.acme.spnego.ber.NegTokenTargDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenTargEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegTokenTargEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenTargEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegotiationTokenDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegotiationTokenDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,27 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegotiationTokenDecoder extends
com.acme.spnego.ber.NegotiationTokenDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegotiationTokenEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/NegotiationTokenEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,40 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.der;
+
+import java.io.OutputStream;
+
+import org.apache.snickers.encoding.Encoder;
+import org.apache.snickers.encoding.EncoderException;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegotiationTokenEncoder implements Encoder
+{
+ public void encode( OutputStream stream, ASN1Type object ) throws
EncoderException
+ {
+ //todo: consider this autogenerated code
+ }
+
+ public int length( ASN1Type object ) throws EncoderException
+ {
+ return 0; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/ContextFlagsDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/ContextFlagsDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ContextFlagsDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/ContextFlagsEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/ContextFlagsEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ContextFlagsEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeListDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeListDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeListDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeListEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/MechTypeListEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class MechTypeListEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenInitDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenInitDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenInitDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenInitEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenInitEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenInitEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenTargDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenTargDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenTargDecoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenTargEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegTokenTargEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,24 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegTokenTargEncoder
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegotiationTokenDecoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegotiationTokenDecoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,35 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+import java.io.InputStream;
+
+import org.apache.snickers.encoding.Decoder;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegotiationTokenDecoder implements Decoder
+{
+ public ASN1Type decode( InputStream stream )
+ {
+ return null; //todo: consider this autogenerated code
+ }
+
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegotiationTokenEncoder.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/NegotiationTokenEncoder.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,40 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.per;
+
+import java.io.OutputStream;
+
+import org.apache.snickers.encoding.Encoder;
+import org.apache.snickers.encoding.EncoderException;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class NegotiationTokenEncoder implements Encoder
+{
+ public void encode( OutputStream stream, ASN1Type object ) throws
EncoderException
+ {
+ //todo: consider this autogenerated code
+ }
+
+ public int length( ASN1Type object ) throws EncoderException
+ {
+ return 0; //todo: consider this autogenerated code
+ }
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/ContextFlagsType.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/ContextFlagsType.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public interface ContextFlagsType extends
org.apache.snickers.runtime.ASN1TypeFlag
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/MechTypeListType.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/MechTypeListType.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public interface MechTypeListType extends
org.apache.snickers.runtime.ASN1TypeFlag
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/MechTypeType.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/MechTypeType.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public interface MechTypeType extends org.apache.snickers.runtime.ASN1TypeFlag
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/NegTokenInitType.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/NegTokenInitType.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public interface NegTokenInitType extends
org.apache.snickers.runtime.ASN1TypeFlag
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/NegTokenTargType.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/NegTokenTargType.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public interface NegTokenTargType extends
org.apache.snickers.runtime.ASN1TypeFlag
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/NegotiationTokenType.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/NegotiationTokenType.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.acme.spnego.type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public interface NegotiationTokenType extends
org.apache.snickers.runtime.ASN1TypeFlag
+{
+}
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/EncodingFactoryTest.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/EncodingFactoryTest.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,135 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.encoding;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import com.acme.spnego.MechType;
+import com.acme.spnego.MechTypeList;
+import com.acme.spnego.NegTokenInit;
+import com.acme.spnego.NegotiationToken;
+import junit.framework.TestCase;
+
+import org.apache.snickers.runtime.ASN1ObjectIdentifier;
+import org.apache.snickers.runtime.ASN1OctetString;
+import org.apache.snickers.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class EncodingFactoryTest extends TestCase
+{
+ public final static TestOID KERBEROS_V5_LEGACY = new TestOID(
"1.2.840.48018.1.2.2" );
+ public final static byte[] header = new byte[]{(byte) 0xa0, (byte) 0x82,
(byte) 0x05, (byte) 0xd8,
+ (byte) 0x30, (byte) 0x82,
(byte) 0x05, (byte) 0xd4,
+ (byte) 0xA0, (byte) 0x18,
+ (byte) 0x30, (byte) 0x16,
+ (byte) 0x06, (byte) 0x09,
(byte) 0x2a, (byte) 0x86, (byte) 0x48, (byte) 0x82, (byte) 0xf7, (byte) 0x12,
(byte) 0x01, (byte) 0x02, (byte) 0x02,
+ (byte) 0x06, (byte) 0x09,
(byte) 0x2a, (byte) 0x86, (byte) 0x48, (byte) 0x86, (byte) 0xf7, (byte) 0x12,
(byte) 0x01, (byte) 0x02, (byte) 0x02,
+ (byte) 0xA2, (byte) 0x82,
(byte) 0x05, (byte) 0xb6,
+ (byte) 0x04, (byte) 0x82,
(byte) 0x05, (byte) 0xb2};
+
+
+ public void testGetEncoder() throws Exception
+ {
+ Encoder encoder = EncodingFactory.getEncoder( "ber",
NegotiationToken.class );
+ Encoder encoderCopy = EncodingFactory.getEncoder( "ber",
NegotiationToken.class );
+
+ assertSame( encoder, encoderCopy );
+ }
+
+ public void testNegotiationTokenEncoding() throws Exception
+ {
+ Encoder encoder = EncodingFactory.getEncoder( "ber",
NegotiationToken.class );
+
+ NegotiationToken negotiationToken = new NegotiationToken();
+ NegTokenInit negTokenInit = new NegTokenInit();
+ negotiationToken.setNegTokenInit( negTokenInit );
+
+ negTokenInit.setMechTypes( new MechTypeList() );
+ negTokenInit.getMechTypes().add( new MechType( KERBEROS_V5_LEGACY ) );
+ negTokenInit.getMechTypes().add( new MechType( new int[]{1, 2, 840,
113554, 1, 2, 2} ) );
+ negTokenInit.setMechToken( new ASN1OctetString( new byte[1458] ) );
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ encoder.encode( out, negotiationToken );
+
+
+ byte[] result = out.toByteArray();
+
+ assertEquals( 1500, result.length );
+
+ for ( int i = 0; i < header.length; i++ )
+ {
+ assertEquals( header[i], result[i] );
+ }
+
+ for ( int i = header.length; i < result.length; i++ )
+ {
+ assertEquals( 0x00, result[i] );
+ }
+ }
+
+ public void testGetDecoder() throws Exception
+ {
+ Decoder decoder = EncodingFactory.getDecoder( "ber",
NegotiationToken.class );
+ Decoder decoderCopy = EncodingFactory.getDecoder( "ber",
NegotiationToken.class );
+
+
+ assertSame( decoder, decoderCopy );
+ }
+
+ public void testNegotiationTokenDecoding() throws Exception
+ {
+ Decoder decoder = EncodingFactory.getDecoder( "ber",
NegotiationToken.class );
+ byte[] message = new byte[1500];
+ System.arraycopy( header, 0, message, 0, header.length );
+
+ ASN1Type result = decoder.decode( new ByteArrayInputStream( message )
);
+ }
+
+ public void setUp()
+ {
+ EncodingFactory.register( new EncodingFactoryDefault( "ber" ) );
+ }
+
+ static class TestOID extends ASN1ObjectIdentifier
+ {
+ public TestOID( String oid )
+ {
+ super( oid );
+ }
+
+ public TestOID( ASN1ObjectIdentifier oid )
+ {
+ super( oid );
+ }
+
+ public TestOID( int id[] )
+ {
+ super( id );
+ }
+
+ public TestOID( ASN1ObjectIdentifier oid, int id[] )
+ {
+ super( oid, id );
+ }
+ }
+
+}
+
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCase.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCase.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCase.java
Mon Sep 13 08:49:12 2004
@@ -19,16 +19,12 @@
import java.nio.ByteBuffer;
import java.util.ArrayList;
-
import junit.framework.TestCase;
import org.apache.commons.codec.binary.Binary;
import org.apache.commons.lang.exception.ExceptionUtils;
-import org.apache.snickers.encoding.ber.Decoder;
-import org.apache.snickers.encoding.ber.DecoderCallback;
+
import org.apache.snickers.encoding.DecoderException;
-import org.apache.snickers.encoding.ber.DecoderMonitor;
-import org.apache.snickers.encoding.ber.Tuple;
/**
@@ -48,7 +44,7 @@
/**
* the decoder that is constructed every time
*/
- protected BERTestDecoder decoder = null;
+ protected AOKTestDecoder decoder = null;
/**
* value accumulator
*/
@@ -60,7 +56,7 @@
/**
* expected state
*/
- BERDecoder.State expectedState;
+ AOKDecoder.State expectedState;
/*
* @see TestCase#setUp()
@@ -68,7 +64,7 @@
protected void setUp() throws Exception
{
super.setUp();
- decoder = new org.apache.snickers.encoding.ber.BERTestDecoder();
+ decoder = new org.apache.snickers.encoding.ber.AOKTestDecoder();
decoder.setCallback( this );
decoder.setDecoderMonitor( this );
level = 0;
@@ -102,7 +98,7 @@
*
* @param expectedState the xpected state when tuple is decoded
*/
- public void setExpectedState( BERDecoder.State expectedState )
+ public void setExpectedState( AOKDecoder.State expectedState )
{
this.expectedState = expectedState;
}
@@ -215,7 +211,7 @@
/**
* BER decodes a string of 0's and 1's.
- *
+ *
* @param bitString a string of ascii 0's and 1's
* @return a copy of the decoded tuple or the partially decoded current tlv
* @throws DecoderException if there are errors while decoding.
@@ -238,7 +234,7 @@
/**
* BER decodes a single byte.
- *
+ *
* @param bite a single byte to decode
* @return a copy of the decoded tuple or the partially decoded current tlv
* @throws DecoderException if there are errors while decoding.
@@ -261,7 +257,7 @@
/**
* BER decodes a byte array.
- *
+ *
* @param bites a byte array to decode
* @return a copy of the decoded tuple or the partially decoded current tlv
* @throws DecoderException if there are errors while decoding.
@@ -283,7 +279,7 @@
/**
* BER decodes a byte buffer.
- *
+ *
* @param bites a byte buffer to decode
* @return a copy of the decoded tuple or the partially decoded current tlv
* @throws DecoderException if there are errors while decoding.
@@ -304,7 +300,7 @@
/**
* First BER encodes then BER decodes a Tuple.
- *
+ *
* @param tlv a tuple to encode then decode
* @return a copy of the decoded tuple or the partially decoded current tlv
* @throws DecoderException if there are errors while decoding
@@ -328,7 +324,7 @@
/**
* First BER encodes then BER decodes a train of Tuples.
- *
+ *
* @param tlvs a tuple array to encode then decode
* @return a copy of the decoded tuple or the partially decoded current tlv
* @throws DecoderException if there are errors while decoding
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCaseTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCaseTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCaseTest.java
Mon Sep 13 08:49:12 2004
@@ -20,7 +20,6 @@
import java.nio.ByteBuffer;
import org.apache.commons.lang.ArrayUtils;
-import org.apache.snickers.encoding.ber.Tuple;
/**
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERDecoderTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERDecoderTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERDecoderTest.java
Mon Sep 13 08:49:12 2004
@@ -22,11 +22,6 @@
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.RandomStringUtils;
-import org.apache.snickers.encoding.ber.Decoder;
-import org.apache.snickers.encoding.ber.DecoderCallback;
-import org.apache.snickers.encoding.ber.DecoderMonitorAdapter;
-import org.apache.snickers.encoding.ber.Tuple;
-import org.apache.snickers.encoding.ber.TypeClass;
/**
@@ -55,7 +50,7 @@
try
{
- decoder.decode( (ByteBuffer)null );
+ decoder.decode( (ByteBuffer) null );
fail( "IllegalArgumentException should have been thrown" );
}
catch ( IllegalArgumentException iae )
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BenchmarkTest.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BenchmarkTest.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,157 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.encoding.ber;
+
+import java.io.ByteArrayOutputStream;
+import java.util.Map;
+import com.acme.spnego.MechType;
+import com.acme.spnego.MechTypeList;
+import com.acme.spnego.NegTokenInit;
+import com.acme.spnego.NegotiationToken;
+import junit.framework.TestCase;
+
+import org.apache.snickers.encoding.Encoder;
+import org.apache.snickers.encoding.EncodingFactory;
+import org.apache.snickers.encoding.EncodingFactoryDefault;
+import org.apache.snickers.encoding.EncodingFactoryTest;
+import org.apache.snickers.runtime.ASN1OctetString;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class BenchmarkTest extends TestCase
+{
+ public void testThreadLocal() throws Exception
+ {
+ long COUNT = 10000000L;
+
+ ThreadLocal local = new ThreadLocal();
+ Map map = new java.util.IdentityHashMap();
+ Integer key = new Integer( 9 );
+ map.put( key, key );
+ local.set( map );
+ long start = System.currentTimeMillis();
+ for ( long i = 0; i < COUNT; i++ )
+ {
+ ( (Map) local.get() ).get( key );
+ }
+ long end = System.currentTimeMillis();
+
+ System.out.println( "thread local.get: " + ( ( end - start ) / 1000.0
) + "s duration" );
+ System.out.println( "thread local.get: " + ( ( end - start ) *
1000000.0 / COUNT ) + "ns" );
+ System.out.println( "thread local.get: " + ( ( end - start ) / ( COUNT
* 1.0 ) ) + "ms\n" );
+ }
+
+ public void testSpeed() throws Exception
+ {
+ long COUNT = 100000L;
+
+ Encoder encoder = EncodingFactory.getEncoder( "ber",
NegotiationToken.class );
+
+ NegotiationToken negotiationToken = new NegotiationToken();
+ NegTokenInit negTokenInit = new NegTokenInit();
+ negotiationToken.setNegTokenInit( negTokenInit );
+
+ negTokenInit.setMechTypes( new MechTypeList() );
+ negTokenInit.getMechTypes().add( new MechType(
EncodingFactoryTest.KERBEROS_V5_LEGACY ) );
+ negTokenInit.getMechTypes().add( new MechType( new int[]{1, 2, 840,
113554, 1, 2, 2} ) );
+ negTokenInit.setMechToken( new ASN1OctetString( new byte[1458] ) );
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream( 2048 );
+ long start = System.currentTimeMillis();
+ for ( long i = 0; i < COUNT; i++ )
+ {
+ out.reset();
+ encoder.encode( out, negotiationToken );
+ }
+ long end = System.currentTimeMillis();
+
+ System.out.println( "encoder.encode: " + ( ( end - start ) / 1000.0 )
+ "s duration" );
+ System.out.println( "encoder.encode: " + ( ( end - start ) * 1000000.0
/ COUNT ) + "ns" );
+ System.out.println( "encoder.encode: " + ( ( end - start ) / ( COUNT *
1.0 ) ) + "ms\n" );
+
+
+ COUNT = 5000000L;
+ encoder = EncodingFactory.getEncoder( "ber", NegTokenInit.class );
+ start = System.currentTimeMillis();
+ for ( long i = 0; i < COUNT; i++ )
+ {
+ ( (BEREncoder) encoder ).length( 5, negTokenInit );
+ }
+ end = System.currentTimeMillis();
+
+ System.out.println( "encoder.length: " + ( ( end - start ) / 1000.0 )
+ "s duration" );
+ System.out.println( "encoder.length: " + ( ( end - start ) * 1000000.0
/ COUNT ) + "ns" );
+ System.out.println( "encoder.length: " + ( ( end - start ) / ( COUNT *
1.0 ) ) + "ms\n" );
+ }
+
+// public void testSNACC4J() throws Exception
+// {
+// long COUNT = 100000L;
+//
+// com.tld.spnego.NegotiationToken negotiationToken = new
com.tld.spnego.NegotiationToken();
+// negotiationToken.choiceId =
com.tld.spnego.NegotiationToken.NEGTOKENINIT_CID;
+// negotiationToken.negTokenInit = new com.tld.spnego.NegTokenInit();
+//
+// negotiationToken.negTokenInit.mechTypes = new
com.tld.spnego.MechTypeList();
+// negotiationToken.negTokenInit.mechTypes.add( new
com.ibm.asn1.ASN1OID( "1.2.840.48018.1.2.2", new int[]{1, 2, 840, 48018, 1, 2,
2} ) );
+// negotiationToken.negTokenInit.mechTypes.add( new
com.ibm.asn1.ASN1OID( "1.2.840.113554.1.2.2", new int[]{1, 2, 840, 113554, 1,
2, 2} ) );
+// negotiationToken.negTokenInit.mechToken = new byte[1458];
+//
+// com.ibm.asn1.BEREncoder out = new com.ibm.asn1.BEREncoder( 2048, 64
);
+// long start = System.currentTimeMillis();
+// for ( long i = 0; i < COUNT; i++ )
+// {
+// out.init();
+// negotiationToken.encode( out );
+// }
+// long end = System.currentTimeMillis();
+//
+// System.out.println( "negotiationToken.encode: " + ( ( end - start )
/ 1000.0 ) + "s duration" );
+// System.out.println( "negotiationToken.encode: " + ( ( end - start )
* 1000000.0 / COUNT ) + "ns" );
+// System.out.println( "negotiationToken.encode: " + ( ( end - start )
/ ( COUNT * 1.0 ) ) + "ms\n" );
+//
+// byte[] target = new byte[]{(byte) 0xa0, (byte) 0x82, (byte) 0x05,
(byte) 0xd8,
+// (byte) 0x30, (byte) 0x82, (byte) 0x05,
(byte) 0xd4,
+// (byte) 0xA0, (byte) 0x18,
+// (byte) 0x30, (byte) 0x16,
+// (byte) 0x06, (byte) 0x09, (byte) 0x2a,
(byte) 0x86, (byte) 0x48, (byte) 0x82, (byte) 0xf7, (byte) 0x12, (byte) 0x01,
(byte) 0x02, (byte) 0x02,
+// (byte) 0x06, (byte) 0x09, (byte) 0x2a,
(byte) 0x86, (byte) 0x48, (byte) 0x86, (byte) 0xf7, (byte) 0x12, (byte) 0x01,
(byte) 0x02, (byte) 0x02,
+// (byte) 0xA2, (byte) 0x82, (byte) 0x05,
(byte) 0xb6,
+// (byte) 0x04, (byte) 0x82, (byte) 0x05,
(byte) 0xb2};
+//
+// byte[] result = out.toByteArray();
+//
+// assertEquals( 1500, result.length );
+//
+// for ( int i = 0; i < target.length; i++ )
+// {
+// assertEquals( target[i], result[i] );
+// }
+//
+// for ( int i = target.length; i < result.length; i++ )
+// {
+// assertEquals( 0x00, result[i] );
+// }
+// }
+
+ public void setUp()
+ {
+ EncodingFactory.register( new EncodingFactoryDefault( "ber" ) );
+ }
+}
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/ConstructedTLVTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/ConstructedTLVTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/ConstructedTLVTest.java
Mon Sep 13 08:49:12 2004
@@ -16,8 +16,7 @@
*/
package org.apache.snickers.encoding.ber;
-import org.apache.snickers.encoding.ber.Tuple;
-import org.apache.snickers.encoding.ber.TypeClass;
+
/**
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/LengthTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/LengthTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/LengthTest.java
Mon Sep 13 08:49:12 2004
@@ -18,10 +18,7 @@
import java.nio.ByteBuffer;
-
import junit.framework.TestCase;
-
-import org.apache.snickers.encoding.ber.Length;
/**
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteLengthTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteLengthTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteLengthTest.java
Mon Sep 13 08:49:12 2004
@@ -16,8 +16,7 @@
*/
package org.apache.snickers.encoding.ber;
-import org.apache.snickers.encoding.ber.Tuple;
-import org.apache.snickers.encoding.ber.TypeClass;
+
/**
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteTagTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteTagTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteTagTest.java
Mon Sep 13 08:49:12 2004
@@ -16,8 +16,7 @@
*/
package org.apache.snickers.encoding.ber;
-import org.apache.snickers.encoding.ber.Tuple;
-import org.apache.snickers.encoding.ber.TypeClass;
+
/**
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SimplePrimitiveTLVTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SimplePrimitiveTLVTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SimplePrimitiveTLVTest.java
Mon Sep 13 08:49:12 2004
@@ -18,9 +18,6 @@
import java.nio.ByteBuffer;
-import org.apache.snickers.encoding.ber.Tuple;
-import org.apache.snickers.encoding.ber.TypeClass;
-
/**
* Performs simple primitive tlv tests.
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteLengthTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteLengthTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteLengthTest.java
Mon Sep 13 08:49:12 2004
@@ -16,8 +16,7 @@
*/
package org.apache.snickers.encoding.ber;
-import org.apache.snickers.encoding.ber.Tuple;
-import org.apache.snickers.encoding.ber.TypeClass;
+
/**
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteTagTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteTagTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteTagTest.java
Mon Sep 13 08:49:12 2004
@@ -16,8 +16,7 @@
*/
package org.apache.snickers.encoding.ber;
-import org.apache.snickers.encoding.ber.TypeClass;
-import org.apache.snickers.encoding.ber.Tuple;
+
/**
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TagTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TagTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TagTest.java
Mon Sep 13 08:49:12 2004
@@ -18,13 +18,9 @@
import java.nio.BufferOverflowException;
-
import junit.framework.TestCase;
import org.apache.commons.lang.ArrayUtils;
-
-import org.apache.snickers.encoding.ber.Tag;
-import org.apache.snickers.encoding.ber.TypeClass;
/**
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TupleTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TupleTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TupleTest.java
Mon Sep 13 08:49:12 2004
@@ -22,9 +22,6 @@
import java.util.Collections;
import org.apache.commons.codec.binary.Binary;
-import org.apache.snickers.encoding.ber.Tuple;
-import org.apache.snickers.encoding.ber.TypeClass;
-import org.apache.snickers.encoding.ber.Length;
/**
@@ -238,7 +235,7 @@
assertEquals( t.getTypeClass(), TypeClass.APPLICATION );
t = new Tuple( 0, 0 );
assertEquals( TypeClass.APPLICATION, t.getTypeClass() );
- t.setTypeClass( TypeClass.PRIVATE);
+ t.setTypeClass( TypeClass.PRIVATE );
assertEquals( TypeClass.PRIVATE, t.getTypeClass() );
}
Modified:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TypeClassTest.java
==============================================================================
---
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TypeClassTest.java
(original)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TypeClassTest.java
Mon Sep 13 08:49:12 2004
@@ -19,10 +19,7 @@
import java.util.List;
import java.util.Map;
-
import junit.framework.TestCase;
-
-import org.apache.snickers.encoding.ber.TypeClass;
/**
Added:
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/runtime/ASN1ObjectIdentifierTest.java
==============================================================================
--- (empty file)
+++
incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/runtime/ASN1ObjectIdentifierTest.java
Mon Sep 13 08:49:12 2004
@@ -0,0 +1,99 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.snickers.runtime;
+
+import junit.framework.TestCase;
+
+
+/**
+ * @version $Revision: $ $Date: $
+ */
+public class ASN1ObjectIdentifierTest extends TestCase
+{
+
+ public void testStringConstructor() throws Exception
+ {
+ ASN1ObjectIdentifier oid = new ASN1ObjectIdentifier( "1.3.6.1.5.5.2" );
+
+ assertTrue( oid.isConsistent() );
+ assertEquals( 7, oid.size() );
+ assertEquals( 1, oid.getId( 0 ) );
+ assertEquals( 3, oid.getId( 1 ) );
+ assertEquals( 6, oid.getId( 2 ) );
+ assertEquals( 1, oid.getId( 3 ) );
+ assertEquals( 5, oid.getId( 4 ) );
+ assertEquals( 5, oid.getId( 5 ) );
+ assertEquals( 2, oid.getId( 6 ) );
+
+ try
+ {
+ oid = new ASN1ObjectIdentifier( "1.34e.42.5" );
+ fail( "Misformated OID should have caused a NumberFormatException"
);
+ }
+ catch ( NumberFormatException nfe )
+ {
+ }
+ }
+
+ public void testArrayConstructor() throws Exception
+ {
+ ASN1ObjectIdentifier oid = new ASN1ObjectIdentifier( new int[]{1, 3,
6, 1, 5, 5, 2} );
+
+ assertTrue( oid.isConsistent() );
+ assertEquals( 7, oid.size() );
+ assertEquals( 1, oid.getId( 0 ) );
+ assertEquals( 3, oid.getId( 1 ) );
+ assertEquals( 6, oid.getId( 2 ) );
+ assertEquals( 1, oid.getId( 3 ) );
+ assertEquals( 5, oid.getId( 4 ) );
+ assertEquals( 5, oid.getId( 5 ) );
+ assertEquals( 2, oid.getId( 6 ) );
+ }
+
+ public void testCopyConstructor() throws Exception
+ {
+ ASN1ObjectIdentifier oid1 = new ASN1ObjectIdentifier( new int[]{1, 3,
6, 1, 5, 5, 2} );
+ ASN1ObjectIdentifier oid2 = new ASN1ObjectIdentifier( oid1 );
+
+ assertTrue( oid2.isConsistent() );
+ assertEquals( 7, oid2.size() );
+ assertEquals( 1, oid2.getId( 0 ) );
+ assertEquals( 3, oid2.getId( 1 ) );
+ assertEquals( 6, oid2.getId( 2 ) );
+ assertEquals( 1, oid2.getId( 3 ) );
+ assertEquals( 5, oid2.getId( 4 ) );
+ assertEquals( 5, oid2.getId( 5 ) );
+ assertEquals( 2, oid2.getId( 6 ) );
+ }
+
+ public void testCopyArrayConstructor() throws Exception
+ {
+ ASN1ObjectIdentifier oid1 = new ASN1ObjectIdentifier( new int[]{1, 3,
6, 1, 5, 5, 2} );
+ ASN1ObjectIdentifier oid2 = new ASN1ObjectIdentifier( oid1, new
int[]{1} );
+
+ assertTrue( oid2.isConsistent() );
+ assertEquals( 8, oid2.size() );
+ assertEquals( 1, oid2.getId( 0 ) );
+ assertEquals( 3, oid2.getId( 1 ) );
+ assertEquals( 6, oid2.getId( 2 ) );
+ assertEquals( 1, oid2.getId( 3 ) );
+ assertEquals( 5, oid2.getId( 4 ) );
+ assertEquals( 5, oid2.getId( 5 ) );
+ assertEquals( 2, oid2.getId( 6 ) );
+ assertEquals( 1, oid2.getId( 7 ) );
+ }
+}