-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1279c45
commit 984fcf6
Showing
27 changed files
with
2,651 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package net.gcdc.camdenm; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Target; | ||
|
||
@Target({ElementType.TYPE}) | ||
public @interface Asn1AnonymousType { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package net.gcdc.camdenm; | ||
|
||
public abstract class Asn1Integer { | ||
@Override public String toString() { | ||
return "" + value; | ||
} | ||
|
||
public long value; | ||
|
||
public long value() { return value; } | ||
|
||
public Asn1Integer() {} | ||
|
||
public Asn1Integer(long value) { | ||
this.value = value; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package net.gcdc.camdenm; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Indicates that the field is OPTIONAL in ASN.1. Implemented as null. Equivalent to @Nullable. | ||
* | ||
* Using Optional<T> would require Manifests to capture generics (like in Gson). | ||
* | ||
*/ | ||
@Target({ElementType.FIELD}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
public @interface Asn1Optional { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.gcdc.camdenm; | ||
|
||
import java.util.AbstractList; | ||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
public class Asn1SequenceOf<T> extends AbstractList<T> { | ||
|
||
private final List<T> bakingList; | ||
|
||
@Override public T get(int index) { | ||
return bakingList.get(index); | ||
} | ||
|
||
@Override public int size() { | ||
return bakingList.size(); | ||
} | ||
|
||
public Asn1SequenceOf() { | ||
bakingList = new ArrayList<>(); | ||
} | ||
|
||
public Asn1SequenceOf(Collection<T> coll) { | ||
bakingList = new ArrayList<>(coll); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package net.gcdc.camdenm; | ||
|
||
import java.util.AbstractList; | ||
import java.util.BitSet; | ||
import java.util.Collection; | ||
|
||
public class Asn1VarSizeBitstring extends AbstractList<Boolean> { | ||
|
||
private final BitSet backing; | ||
|
||
@Override public Boolean get(int index) { | ||
return backing.get(index); | ||
} | ||
|
||
@Override public int size() { | ||
return backing.length(); | ||
} | ||
|
||
public Asn1VarSizeBitstring(Collection<Boolean> coll) { | ||
backing = new BitSet(); | ||
int bitIndex = 0; | ||
for (Boolean b : coll) { | ||
backing.set(bitIndex, b); | ||
bitIndex++; | ||
} | ||
} | ||
|
||
protected void setBit(int bitIndex, boolean value) { | ||
backing.set(bitIndex, value); | ||
} | ||
|
||
public boolean getBit(int bitIndex) { | ||
return backing.get(bitIndex); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net.gcdc.camdenm; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target({ElementType.TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface Bitstring { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net.gcdc.camdenm; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target({ElementType.TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface Choice { | ||
|
||
} |
Oops, something went wrong.