check in the generated ASN.1 beans
This will facilitate inclusion of OpenEUICC in AOSP source tree
This commit is contained in:
parent
2034d72b60
commit
9ca7ac91be
|
@ -15,11 +15,11 @@ dependencies {
|
|||
testImplementation 'com.github.tomakehurst:wiremock:2.17.0'
|
||||
}
|
||||
|
||||
sourceSets.main.java.srcDirs = ['build/generated-sources/asn1','src/main/java']
|
||||
sourceSets.main.java.srcDirs = ['src/generated/asn1','src/main/java']
|
||||
|
||||
task genAsn1(type: JavaExec) {
|
||||
mainClass = 'com.beanit.asn1bean.compiler.Compiler'
|
||||
args "-o", "$projectDir/build/generated-sources/asn1", "-p", "com.truphone.rsp.dto.asn1", "-f", "$projectDir/src/main/resources/PKIXExplicit88.asn", "$projectDir/src/main/resources/PKIXImplicit88.asn", "$projectDir/src/main/resources/rsp.asn"
|
||||
args "-o", "$projectDir/src/generated/asn1", "-p", "com.truphone.rsp.dto.asn1", "-f", "$projectDir/src/main/resources/PKIXExplicit88.asn", "$projectDir/src/main/resources/PKIXImplicit88.asn", "$projectDir/src/main/resources/rsp.asn"
|
||||
classpath configurations.tool
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,153 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class AdministrationDomainName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
public static final BerTag tag = new BerTag(BerTag.APPLICATION_CLASS, BerTag.CONSTRUCTED, 2);
|
||||
|
||||
private BerNumericString numeric = null;
|
||||
private BerPrintableString printable = null;
|
||||
|
||||
public AdministrationDomainName() {
|
||||
}
|
||||
|
||||
public AdministrationDomainName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setNumeric(BerNumericString numeric) {
|
||||
this.numeric = numeric;
|
||||
}
|
||||
|
||||
public BerNumericString getNumeric() {
|
||||
return numeric;
|
||||
}
|
||||
|
||||
public void setPrintable(BerPrintableString printable) {
|
||||
this.printable = printable;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintable() {
|
||||
return printable;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (printable != null) {
|
||||
codeLength += printable.encode(reverseOS, true);
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (numeric != null) {
|
||||
codeLength += numeric.encode(reverseOS, true);
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlvByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlvByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength explicitTagLength = new BerLength();
|
||||
tlvByteCount += explicitTagLength.decode(is);
|
||||
tlvByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerNumericString.tag)) {
|
||||
numeric = new BerNumericString();
|
||||
tlvByteCount += numeric.decode(is, false);
|
||||
tlvByteCount += explicitTagLength.readEocIfIndefinite(is);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printable = new BerPrintableString();
|
||||
tlvByteCount += printable.decode(is, false);
|
||||
tlvByteCount += explicitTagLength.readEocIfIndefinite(is);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (numeric != null) {
|
||||
sb.append("numeric: ").append(numeric);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printable != null) {
|
||||
sb.append("printable: ").append(printable);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class AlgorithmIdentifier implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerObjectIdentifier algorithm = null;
|
||||
private BerAny parameters = null;
|
||||
|
||||
public AlgorithmIdentifier() {
|
||||
}
|
||||
|
||||
public AlgorithmIdentifier(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setAlgorithm(BerObjectIdentifier algorithm) {
|
||||
this.algorithm = algorithm;
|
||||
}
|
||||
|
||||
public BerObjectIdentifier getAlgorithm() {
|
||||
return algorithm;
|
||||
}
|
||||
|
||||
public void setParameters(BerAny parameters) {
|
||||
this.parameters = parameters;
|
||||
}
|
||||
|
||||
public BerAny getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (parameters != null) {
|
||||
codeLength += parameters.encode(reverseOS);
|
||||
}
|
||||
|
||||
codeLength += algorithm.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerObjectIdentifier.tag)) {
|
||||
algorithm = new BerObjectIdentifier();
|
||||
vByteCount += algorithm.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
parameters = new BerAny();
|
||||
numDecodedBytes = parameters.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
parameters = null;
|
||||
}
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (algorithm != null) {
|
||||
sb.append("algorithm: ").append(algorithm);
|
||||
}
|
||||
else {
|
||||
sb.append("algorithm: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (parameters != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("parameters: ").append(parameters);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,317 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class Attribute implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class Values implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17);
|
||||
private byte[] code = null;
|
||||
private List<AttributeValue> seqOf = null;
|
||||
|
||||
public Values() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public Values(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<AttributeValue> getAttributeValue() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
AttributeValue element = new AttributeValue();
|
||||
numDecodedBytes = element.decode(is, berTag);
|
||||
if (numDecodedBytes == 0) {
|
||||
throw new IOException("Tag did not match");
|
||||
}
|
||||
vByteCount += numDecodedBytes;
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<AttributeValue> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private AttributeType type = null;
|
||||
private Values values = null;
|
||||
|
||||
public Attribute() {
|
||||
}
|
||||
|
||||
public Attribute(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setType(AttributeType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public AttributeType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setValues(Values values) {
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public Values getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += values.encode(reverseOS, true);
|
||||
|
||||
codeLength += type.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(AttributeType.tag)) {
|
||||
type = new AttributeType();
|
||||
vByteCount += type.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(Values.tag)) {
|
||||
values = new Values();
|
||||
vByteCount += values.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (type != null) {
|
||||
sb.append("type: ").append(type);
|
||||
}
|
||||
else {
|
||||
sb.append("type: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (values != null) {
|
||||
sb.append("values: ");
|
||||
values.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("values: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class AttributeType extends BerObjectIdentifier {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public AttributeType() {
|
||||
}
|
||||
|
||||
public AttributeType(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public AttributeType(int[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class AttributeTypeAndValue implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private AttributeType type = null;
|
||||
private AttributeValue value = null;
|
||||
|
||||
public AttributeTypeAndValue() {
|
||||
}
|
||||
|
||||
public AttributeTypeAndValue(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setType(AttributeType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public AttributeType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setValue(AttributeValue value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public AttributeValue getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += value.encode(reverseOS);
|
||||
|
||||
codeLength += type.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(AttributeType.tag)) {
|
||||
type = new AttributeType();
|
||||
vByteCount += type.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
value = new AttributeValue();
|
||||
numDecodedBytes = value.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (type != null) {
|
||||
sb.append("type: ").append(type);
|
||||
}
|
||||
else {
|
||||
sb.append("type: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (value != null) {
|
||||
sb.append("value: ").append(value);
|
||||
}
|
||||
else {
|
||||
sb.append("value: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class AttributeValue extends BerAny {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public AttributeValue() {
|
||||
}
|
||||
|
||||
public AttributeValue(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class BuiltInDomainDefinedAttribute implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerPrintableString type = null;
|
||||
private BerPrintableString value = null;
|
||||
|
||||
public BuiltInDomainDefinedAttribute() {
|
||||
}
|
||||
|
||||
public BuiltInDomainDefinedAttribute(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setType(BerPrintableString type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public BerPrintableString getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setValue(BerPrintableString value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public BerPrintableString getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += value.encode(reverseOS, true);
|
||||
|
||||
codeLength += type.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
type = new BerPrintableString();
|
||||
vByteCount += type.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
value = new BerPrintableString();
|
||||
vByteCount += value.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (type != null) {
|
||||
sb.append("type: ").append(type);
|
||||
}
|
||||
else {
|
||||
sb.append("type: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (value != null) {
|
||||
sb.append("value: ").append(value);
|
||||
}
|
||||
else {
|
||||
sb.append("value: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class BuiltInDomainDefinedAttributes implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<BuiltInDomainDefinedAttribute> seqOf = null;
|
||||
|
||||
public BuiltInDomainDefinedAttributes() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public BuiltInDomainDefinedAttributes(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<BuiltInDomainDefinedAttribute> getBuiltInDomainDefinedAttribute() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(BuiltInDomainDefinedAttribute.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
BuiltInDomainDefinedAttribute element = new BuiltInDomainDefinedAttribute();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<BuiltInDomainDefinedAttribute> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,446 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class BuiltInStandardAttributes implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private CountryName countryName = null;
|
||||
private AdministrationDomainName administrationDomainName = null;
|
||||
private NetworkAddress networkAddress = null;
|
||||
private TerminalIdentifier terminalIdentifier = null;
|
||||
private PrivateDomainName privateDomainName = null;
|
||||
private OrganizationName organizationName = null;
|
||||
private NumericUserIdentifier numericUserIdentifier = null;
|
||||
private PersonalName personalName = null;
|
||||
private OrganizationalUnitNames organizationalUnitNames = null;
|
||||
|
||||
public BuiltInStandardAttributes() {
|
||||
}
|
||||
|
||||
public BuiltInStandardAttributes(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setCountryName(CountryName countryName) {
|
||||
this.countryName = countryName;
|
||||
}
|
||||
|
||||
public CountryName getCountryName() {
|
||||
return countryName;
|
||||
}
|
||||
|
||||
public void setAdministrationDomainName(AdministrationDomainName administrationDomainName) {
|
||||
this.administrationDomainName = administrationDomainName;
|
||||
}
|
||||
|
||||
public AdministrationDomainName getAdministrationDomainName() {
|
||||
return administrationDomainName;
|
||||
}
|
||||
|
||||
public void setNetworkAddress(NetworkAddress networkAddress) {
|
||||
this.networkAddress = networkAddress;
|
||||
}
|
||||
|
||||
public NetworkAddress getNetworkAddress() {
|
||||
return networkAddress;
|
||||
}
|
||||
|
||||
public void setTerminalIdentifier(TerminalIdentifier terminalIdentifier) {
|
||||
this.terminalIdentifier = terminalIdentifier;
|
||||
}
|
||||
|
||||
public TerminalIdentifier getTerminalIdentifier() {
|
||||
return terminalIdentifier;
|
||||
}
|
||||
|
||||
public void setPrivateDomainName(PrivateDomainName privateDomainName) {
|
||||
this.privateDomainName = privateDomainName;
|
||||
}
|
||||
|
||||
public PrivateDomainName getPrivateDomainName() {
|
||||
return privateDomainName;
|
||||
}
|
||||
|
||||
public void setOrganizationName(OrganizationName organizationName) {
|
||||
this.organizationName = organizationName;
|
||||
}
|
||||
|
||||
public OrganizationName getOrganizationName() {
|
||||
return organizationName;
|
||||
}
|
||||
|
||||
public void setNumericUserIdentifier(NumericUserIdentifier numericUserIdentifier) {
|
||||
this.numericUserIdentifier = numericUserIdentifier;
|
||||
}
|
||||
|
||||
public NumericUserIdentifier getNumericUserIdentifier() {
|
||||
return numericUserIdentifier;
|
||||
}
|
||||
|
||||
public void setPersonalName(PersonalName personalName) {
|
||||
this.personalName = personalName;
|
||||
}
|
||||
|
||||
public PersonalName getPersonalName() {
|
||||
return personalName;
|
||||
}
|
||||
|
||||
public void setOrganizationalUnitNames(OrganizationalUnitNames organizationalUnitNames) {
|
||||
this.organizationalUnitNames = organizationalUnitNames;
|
||||
}
|
||||
|
||||
public OrganizationalUnitNames getOrganizationalUnitNames() {
|
||||
return organizationalUnitNames;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (organizationalUnitNames != null) {
|
||||
codeLength += organizationalUnitNames.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 6
|
||||
reverseOS.write(0xA6);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (personalName != null) {
|
||||
codeLength += personalName.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
|
||||
reverseOS.write(0xA5);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (numericUserIdentifier != null) {
|
||||
codeLength += numericUserIdentifier.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 4
|
||||
reverseOS.write(0x84);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (organizationName != null) {
|
||||
codeLength += organizationName.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
|
||||
reverseOS.write(0x83);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (privateDomainName != null) {
|
||||
sublength = privateDomainName.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
reverseOS.write(0xA2);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (terminalIdentifier != null) {
|
||||
codeLength += terminalIdentifier.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (networkAddress != null) {
|
||||
codeLength += networkAddress.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (administrationDomainName != null) {
|
||||
codeLength += administrationDomainName.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
if (countryName != null) {
|
||||
codeLength += countryName.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
if (lengthVal == 0) {
|
||||
return tlByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(CountryName.tag)) {
|
||||
countryName = new CountryName();
|
||||
vByteCount += countryName.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(AdministrationDomainName.tag)) {
|
||||
administrationDomainName = new AdministrationDomainName();
|
||||
vByteCount += administrationDomainName.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
networkAddress = new NetworkAddress();
|
||||
vByteCount += networkAddress.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
terminalIdentifier = new TerminalIdentifier();
|
||||
vByteCount += terminalIdentifier.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
vByteCount += length.decode(is);
|
||||
privateDomainName = new PrivateDomainName();
|
||||
vByteCount += privateDomainName.decode(is, null);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
|
||||
organizationName = new OrganizationName();
|
||||
vByteCount += organizationName.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) {
|
||||
numericUserIdentifier = new NumericUserIdentifier();
|
||||
vByteCount += numericUserIdentifier.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
|
||||
personalName = new PersonalName();
|
||||
vByteCount += personalName.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 6)) {
|
||||
organizationalUnitNames = new OrganizationalUnitNames();
|
||||
vByteCount += organizationalUnitNames.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (countryName != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("countryName: ");
|
||||
countryName.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (administrationDomainName != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("administrationDomainName: ");
|
||||
administrationDomainName.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (networkAddress != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("networkAddress: ").append(networkAddress);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (terminalIdentifier != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("terminalIdentifier: ").append(terminalIdentifier);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (privateDomainName != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("privateDomainName: ");
|
||||
privateDomainName.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (organizationName != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("organizationName: ").append(organizationName);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (numericUserIdentifier != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("numericUserIdentifier: ").append(numericUserIdentifier);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (personalName != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("personalName: ");
|
||||
personalName.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (organizationalUnitNames != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("organizationalUnitNames: ");
|
||||
organizationalUnitNames.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class Certificate implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private TBSCertificate tbsCertificate = null;
|
||||
private AlgorithmIdentifier signatureAlgorithm = null;
|
||||
private BerBitString signature = null;
|
||||
|
||||
public Certificate() {
|
||||
}
|
||||
|
||||
public Certificate(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTbsCertificate(TBSCertificate tbsCertificate) {
|
||||
this.tbsCertificate = tbsCertificate;
|
||||
}
|
||||
|
||||
public TBSCertificate getTbsCertificate() {
|
||||
return tbsCertificate;
|
||||
}
|
||||
|
||||
public void setSignatureAlgorithm(AlgorithmIdentifier signatureAlgorithm) {
|
||||
this.signatureAlgorithm = signatureAlgorithm;
|
||||
}
|
||||
|
||||
public AlgorithmIdentifier getSignatureAlgorithm() {
|
||||
return signatureAlgorithm;
|
||||
}
|
||||
|
||||
public void setSignature(BerBitString signature) {
|
||||
this.signature = signature;
|
||||
}
|
||||
|
||||
public BerBitString getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += signature.encode(reverseOS, true);
|
||||
|
||||
codeLength += signatureAlgorithm.encode(reverseOS, true);
|
||||
|
||||
codeLength += tbsCertificate.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(TBSCertificate.tag)) {
|
||||
tbsCertificate = new TBSCertificate();
|
||||
vByteCount += tbsCertificate.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(AlgorithmIdentifier.tag)) {
|
||||
signatureAlgorithm = new AlgorithmIdentifier();
|
||||
vByteCount += signatureAlgorithm.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBitString.tag)) {
|
||||
signature = new BerBitString();
|
||||
vByteCount += signature.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (tbsCertificate != null) {
|
||||
sb.append("tbsCertificate: ");
|
||||
tbsCertificate.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("tbsCertificate: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (signatureAlgorithm != null) {
|
||||
sb.append("signatureAlgorithm: ");
|
||||
signatureAlgorithm.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("signatureAlgorithm: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (signature != null) {
|
||||
sb.append("signature: ").append(signature);
|
||||
}
|
||||
else {
|
||||
sb.append("signature: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class CertificateList implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private TBSCertList tbsCertList = null;
|
||||
private AlgorithmIdentifier signatureAlgorithm = null;
|
||||
private BerBitString signature = null;
|
||||
|
||||
public CertificateList() {
|
||||
}
|
||||
|
||||
public CertificateList(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTbsCertList(TBSCertList tbsCertList) {
|
||||
this.tbsCertList = tbsCertList;
|
||||
}
|
||||
|
||||
public TBSCertList getTbsCertList() {
|
||||
return tbsCertList;
|
||||
}
|
||||
|
||||
public void setSignatureAlgorithm(AlgorithmIdentifier signatureAlgorithm) {
|
||||
this.signatureAlgorithm = signatureAlgorithm;
|
||||
}
|
||||
|
||||
public AlgorithmIdentifier getSignatureAlgorithm() {
|
||||
return signatureAlgorithm;
|
||||
}
|
||||
|
||||
public void setSignature(BerBitString signature) {
|
||||
this.signature = signature;
|
||||
}
|
||||
|
||||
public BerBitString getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += signature.encode(reverseOS, true);
|
||||
|
||||
codeLength += signatureAlgorithm.encode(reverseOS, true);
|
||||
|
||||
codeLength += tbsCertList.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(TBSCertList.tag)) {
|
||||
tbsCertList = new TBSCertList();
|
||||
vByteCount += tbsCertList.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(AlgorithmIdentifier.tag)) {
|
||||
signatureAlgorithm = new AlgorithmIdentifier();
|
||||
vByteCount += signatureAlgorithm.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBitString.tag)) {
|
||||
signature = new BerBitString();
|
||||
vByteCount += signature.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (tbsCertList != null) {
|
||||
sb.append("tbsCertList: ");
|
||||
tbsCertList.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("tbsCertList: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (signatureAlgorithm != null) {
|
||||
sb.append("signatureAlgorithm: ");
|
||||
signatureAlgorithm.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("signatureAlgorithm: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (signature != null) {
|
||||
sb.append("signature: ").append(signature);
|
||||
}
|
||||
else {
|
||||
sb.append("signature: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class CertificateSerialNumber extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CertificateSerialNumber() {
|
||||
}
|
||||
|
||||
public CertificateSerialNumber(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public CertificateSerialNumber(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public CertificateSerialNumber(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class CommonName extends BerPrintableString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CommonName() {
|
||||
}
|
||||
|
||||
public CommonName(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,153 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class CountryName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
public static final BerTag tag = new BerTag(BerTag.APPLICATION_CLASS, BerTag.CONSTRUCTED, 1);
|
||||
|
||||
private BerNumericString x121DccCode = null;
|
||||
private BerPrintableString iso3166Alpha2Code = null;
|
||||
|
||||
public CountryName() {
|
||||
}
|
||||
|
||||
public CountryName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setX121DccCode(BerNumericString x121DccCode) {
|
||||
this.x121DccCode = x121DccCode;
|
||||
}
|
||||
|
||||
public BerNumericString getX121DccCode() {
|
||||
return x121DccCode;
|
||||
}
|
||||
|
||||
public void setIso3166Alpha2Code(BerPrintableString iso3166Alpha2Code) {
|
||||
this.iso3166Alpha2Code = iso3166Alpha2Code;
|
||||
}
|
||||
|
||||
public BerPrintableString getIso3166Alpha2Code() {
|
||||
return iso3166Alpha2Code;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (iso3166Alpha2Code != null) {
|
||||
codeLength += iso3166Alpha2Code.encode(reverseOS, true);
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (x121DccCode != null) {
|
||||
codeLength += x121DccCode.encode(reverseOS, true);
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlvByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlvByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength explicitTagLength = new BerLength();
|
||||
tlvByteCount += explicitTagLength.decode(is);
|
||||
tlvByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerNumericString.tag)) {
|
||||
x121DccCode = new BerNumericString();
|
||||
tlvByteCount += x121DccCode.decode(is, false);
|
||||
tlvByteCount += explicitTagLength.readEocIfIndefinite(is);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
iso3166Alpha2Code = new BerPrintableString();
|
||||
tlvByteCount += iso3166Alpha2Code.decode(is, false);
|
||||
tlvByteCount += explicitTagLength.readEocIfIndefinite(is);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (x121DccCode != null) {
|
||||
sb.append("x121DccCode: ").append(x121DccCode);
|
||||
return;
|
||||
}
|
||||
|
||||
if (iso3166Alpha2Code != null) {
|
||||
sb.append("iso3166Alpha2Code: ").append(iso3166Alpha2Code);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class DirectoryString implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
private BerPrintableString printableString = null;
|
||||
private BerUniversalString universalString = null;
|
||||
private BerUTF8String utf8String = null;
|
||||
private BerBMPString bmpString = null;
|
||||
|
||||
public DirectoryString() {
|
||||
}
|
||||
|
||||
public DirectoryString(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
public void setPrintableString(BerPrintableString printableString) {
|
||||
this.printableString = printableString;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableString() {
|
||||
return printableString;
|
||||
}
|
||||
|
||||
public void setUniversalString(BerUniversalString universalString) {
|
||||
this.universalString = universalString;
|
||||
}
|
||||
|
||||
public BerUniversalString getUniversalString() {
|
||||
return universalString;
|
||||
}
|
||||
|
||||
public void setUtf8String(BerUTF8String utf8String) {
|
||||
this.utf8String = utf8String;
|
||||
}
|
||||
|
||||
public BerUTF8String getUtf8String() {
|
||||
return utf8String;
|
||||
}
|
||||
|
||||
public void setBmpString(BerBMPString bmpString) {
|
||||
this.bmpString = bmpString;
|
||||
}
|
||||
|
||||
public BerBMPString getBmpString() {
|
||||
return bmpString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (bmpString != null) {
|
||||
codeLength += bmpString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
codeLength += utf8String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
codeLength += universalString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
codeLength += printableString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
tlvByteCount += teletexString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableString = new BerPrintableString();
|
||||
tlvByteCount += printableString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUniversalString.tag)) {
|
||||
universalString = new BerUniversalString();
|
||||
tlvByteCount += universalString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUTF8String.tag)) {
|
||||
utf8String = new BerUTF8String();
|
||||
tlvByteCount += utf8String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBMPString.tag)) {
|
||||
bmpString = new BerBMPString();
|
||||
tlvByteCount += bmpString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (teletexString != null) {
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
sb.append("printableString: ").append(printableString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
sb.append("universalString: ").append(universalString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
sb.append("utf8String: ").append(utf8String);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
sb.append("bmpString: ").append(bmpString);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class DistinguishedName extends RDNSequence {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public DistinguishedName() {
|
||||
}
|
||||
|
||||
public DistinguishedName(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class DomainComponent extends BerIA5String {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public DomainComponent() {
|
||||
}
|
||||
|
||||
public DomainComponent(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class EmailAddress extends BerIA5String {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public EmailAddress() {
|
||||
}
|
||||
|
||||
public EmailAddress(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,305 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class ExtendedNetworkAddress implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
public static class E1634Address implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerNumericString number = null;
|
||||
private BerNumericString subAddress = null;
|
||||
|
||||
public E1634Address() {
|
||||
}
|
||||
|
||||
public E1634Address(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setNumber(BerNumericString number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public BerNumericString getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setSubAddress(BerNumericString subAddress) {
|
||||
this.subAddress = subAddress;
|
||||
}
|
||||
|
||||
public BerNumericString getSubAddress() {
|
||||
return subAddress;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (subAddress != null) {
|
||||
codeLength += subAddress.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += number.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
number = new BerNumericString();
|
||||
vByteCount += number.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
subAddress = new BerNumericString();
|
||||
vByteCount += subAddress.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (number != null) {
|
||||
sb.append("number: ").append(number);
|
||||
}
|
||||
else {
|
||||
sb.append("number: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (subAddress != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("subAddress: ").append(subAddress);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private E1634Address e1634Address = null;
|
||||
private PresentationAddress psapAddress = null;
|
||||
|
||||
public ExtendedNetworkAddress() {
|
||||
}
|
||||
|
||||
public ExtendedNetworkAddress(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setE1634Address(E1634Address e1634Address) {
|
||||
this.e1634Address = e1634Address;
|
||||
}
|
||||
|
||||
public E1634Address getE1634Address() {
|
||||
return e1634Address;
|
||||
}
|
||||
|
||||
public void setPsapAddress(PresentationAddress psapAddress) {
|
||||
this.psapAddress = psapAddress;
|
||||
}
|
||||
|
||||
public PresentationAddress getPsapAddress() {
|
||||
return psapAddress;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (psapAddress != null) {
|
||||
codeLength += psapAddress.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (e1634Address != null) {
|
||||
codeLength += e1634Address.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(E1634Address.tag)) {
|
||||
e1634Address = new E1634Address();
|
||||
tlvByteCount += e1634Address.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
psapAddress = new PresentationAddress();
|
||||
tlvByteCount += psapAddress.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (e1634Address != null) {
|
||||
sb.append("e1634Address: ");
|
||||
e1634Address.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (psapAddress != null) {
|
||||
sb.append("psapAddress: ");
|
||||
psapAddress.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,208 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class Extension implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerObjectIdentifier extnID = null;
|
||||
private BerBoolean critical = null;
|
||||
private BerOctetString extnValue = null;
|
||||
|
||||
public Extension() {
|
||||
}
|
||||
|
||||
public Extension(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setExtnID(BerObjectIdentifier extnID) {
|
||||
this.extnID = extnID;
|
||||
}
|
||||
|
||||
public BerObjectIdentifier getExtnID() {
|
||||
return extnID;
|
||||
}
|
||||
|
||||
public void setCritical(BerBoolean critical) {
|
||||
this.critical = critical;
|
||||
}
|
||||
|
||||
public BerBoolean getCritical() {
|
||||
return critical;
|
||||
}
|
||||
|
||||
public void setExtnValue(BerOctetString extnValue) {
|
||||
this.extnValue = extnValue;
|
||||
}
|
||||
|
||||
public BerOctetString getExtnValue() {
|
||||
return extnValue;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += extnValue.encode(reverseOS, true);
|
||||
|
||||
if (critical != null) {
|
||||
codeLength += critical.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += extnID.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerObjectIdentifier.tag)) {
|
||||
extnID = new BerObjectIdentifier();
|
||||
vByteCount += extnID.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBoolean.tag)) {
|
||||
critical = new BerBoolean();
|
||||
vByteCount += critical.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerOctetString.tag)) {
|
||||
extnValue = new BerOctetString();
|
||||
vByteCount += extnValue.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (extnID != null) {
|
||||
sb.append("extnID: ").append(extnID);
|
||||
}
|
||||
else {
|
||||
sb.append("extnID: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (critical != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("critical: ").append(critical);
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (extnValue != null) {
|
||||
sb.append("extnValue: ").append(extnValue);
|
||||
}
|
||||
else {
|
||||
sb.append("extnValue: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,193 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class ExtensionAttribute implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerInteger extensionAttributeType = null;
|
||||
private BerAny extensionAttributeValue = null;
|
||||
|
||||
public ExtensionAttribute() {
|
||||
}
|
||||
|
||||
public ExtensionAttribute(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setExtensionAttributeType(BerInteger extensionAttributeType) {
|
||||
this.extensionAttributeType = extensionAttributeType;
|
||||
}
|
||||
|
||||
public BerInteger getExtensionAttributeType() {
|
||||
return extensionAttributeType;
|
||||
}
|
||||
|
||||
public void setExtensionAttributeValue(BerAny extensionAttributeValue) {
|
||||
this.extensionAttributeValue = extensionAttributeValue;
|
||||
}
|
||||
|
||||
public BerAny getExtensionAttributeValue() {
|
||||
return extensionAttributeValue;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
sublength = extensionAttributeValue.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += extensionAttributeType.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
extensionAttributeType = new BerInteger();
|
||||
vByteCount += extensionAttributeType.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
vByteCount += length.decode(is);
|
||||
extensionAttributeValue = new BerAny();
|
||||
vByteCount += extensionAttributeValue.decode(is, null);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (extensionAttributeType != null) {
|
||||
sb.append("extensionAttributeType: ").append(extensionAttributeType);
|
||||
}
|
||||
else {
|
||||
sb.append("extensionAttributeType: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (extensionAttributeValue != null) {
|
||||
sb.append("extensionAttributeValue: ").append(extensionAttributeValue);
|
||||
}
|
||||
else {
|
||||
sb.append("extensionAttributeValue: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class ExtensionAttributes implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17);
|
||||
private byte[] code = null;
|
||||
private List<ExtensionAttribute> seqOf = null;
|
||||
|
||||
public ExtensionAttributes() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public ExtensionAttributes(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<ExtensionAttribute> getExtensionAttribute() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(ExtensionAttribute.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
ExtensionAttribute element = new ExtensionAttribute();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<ExtensionAttribute> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class ExtensionORAddressComponents extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ExtensionORAddressComponents() {
|
||||
}
|
||||
|
||||
public ExtensionORAddressComponents(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class ExtensionPhysicalDeliveryAddressComponents extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ExtensionPhysicalDeliveryAddressComponents() {
|
||||
}
|
||||
|
||||
public ExtensionPhysicalDeliveryAddressComponents(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class Extensions implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<Extension> seqOf = null;
|
||||
|
||||
public Extensions() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public Extensions(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<Extension> getExtension() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(Extension.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
Extension element = new Extension();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<Extension> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class LocalPostalAttributes extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public LocalPostalAttributes() {
|
||||
}
|
||||
|
||||
public LocalPostalAttributes(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class Name implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private RDNSequence rdnSequence = null;
|
||||
|
||||
public Name() {
|
||||
}
|
||||
|
||||
public Name(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setRdnSequence(RDNSequence rdnSequence) {
|
||||
this.rdnSequence = rdnSequence;
|
||||
}
|
||||
|
||||
public RDNSequence getRdnSequence() {
|
||||
return rdnSequence;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (rdnSequence != null) {
|
||||
codeLength += rdnSequence.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(RDNSequence.tag)) {
|
||||
rdnSequence = new RDNSequence();
|
||||
tlvByteCount += rdnSequence.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (rdnSequence != null) {
|
||||
sb.append("rdnSequence: ");
|
||||
rdnSequence.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class NetworkAddress extends X121Address {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public NetworkAddress() {
|
||||
}
|
||||
|
||||
public NetworkAddress(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class NumericUserIdentifier extends BerNumericString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public NumericUserIdentifier() {
|
||||
}
|
||||
|
||||
public NumericUserIdentifier(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,213 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class ORAddress implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BuiltInStandardAttributes builtInStandardAttributes = null;
|
||||
private BuiltInDomainDefinedAttributes builtInDomainDefinedAttributes = null;
|
||||
private ExtensionAttributes extensionAttributes = null;
|
||||
|
||||
public ORAddress() {
|
||||
}
|
||||
|
||||
public ORAddress(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setBuiltInStandardAttributes(BuiltInStandardAttributes builtInStandardAttributes) {
|
||||
this.builtInStandardAttributes = builtInStandardAttributes;
|
||||
}
|
||||
|
||||
public BuiltInStandardAttributes getBuiltInStandardAttributes() {
|
||||
return builtInStandardAttributes;
|
||||
}
|
||||
|
||||
public void setBuiltInDomainDefinedAttributes(BuiltInDomainDefinedAttributes builtInDomainDefinedAttributes) {
|
||||
this.builtInDomainDefinedAttributes = builtInDomainDefinedAttributes;
|
||||
}
|
||||
|
||||
public BuiltInDomainDefinedAttributes getBuiltInDomainDefinedAttributes() {
|
||||
return builtInDomainDefinedAttributes;
|
||||
}
|
||||
|
||||
public void setExtensionAttributes(ExtensionAttributes extensionAttributes) {
|
||||
this.extensionAttributes = extensionAttributes;
|
||||
}
|
||||
|
||||
public ExtensionAttributes getExtensionAttributes() {
|
||||
return extensionAttributes;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (extensionAttributes != null) {
|
||||
codeLength += extensionAttributes.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
if (builtInDomainDefinedAttributes != null) {
|
||||
codeLength += builtInDomainDefinedAttributes.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += builtInStandardAttributes.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BuiltInStandardAttributes.tag)) {
|
||||
builtInStandardAttributes = new BuiltInStandardAttributes();
|
||||
vByteCount += builtInStandardAttributes.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BuiltInDomainDefinedAttributes.tag)) {
|
||||
builtInDomainDefinedAttributes = new BuiltInDomainDefinedAttributes();
|
||||
vByteCount += builtInDomainDefinedAttributes.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(ExtensionAttributes.tag)) {
|
||||
extensionAttributes = new ExtensionAttributes();
|
||||
vByteCount += extensionAttributes.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (builtInStandardAttributes != null) {
|
||||
sb.append("builtInStandardAttributes: ");
|
||||
builtInStandardAttributes.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("builtInStandardAttributes: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (builtInDomainDefinedAttributes != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("builtInDomainDefinedAttributes: ");
|
||||
builtInDomainDefinedAttributes.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
if (extensionAttributes != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("extensionAttributes: ");
|
||||
extensionAttributes.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public final class OidValues {
|
||||
public static final BerObjectIdentifier idAd = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7, 48});
|
||||
public static final BerObjectIdentifier idAdCaIssuers = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7, 48, 2});
|
||||
public static final BerObjectIdentifier idAdCaRepository = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7, 48, 5});
|
||||
public static final BerObjectIdentifier idAdOcsp = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7, 48, 1});
|
||||
public static final BerObjectIdentifier idAdTimeStamping = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7, 48, 3});
|
||||
public static final BerObjectIdentifier idAt = new BerObjectIdentifier(new int[]{2, 5, 4});
|
||||
public static final BerObjectIdentifier idKp = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7, 3});
|
||||
public static final BerObjectIdentifier idPe = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7, 1});
|
||||
public static final BerObjectIdentifier idPkix = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7});
|
||||
public static final BerObjectIdentifier idQt = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7, 2});
|
||||
public static final BerObjectIdentifier idQtCps = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7, 2, 1});
|
||||
public static final BerObjectIdentifier idQtUnotice = new BerObjectIdentifier(new int[]{1, 3, 6, 1, 5, 5, 7, 2, 2});
|
||||
public static final BerObjectIdentifier pkcs9 = new BerObjectIdentifier(new int[]{1, 2, 840, 113549, 1, 9});
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class OrganizationName extends BerPrintableString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public OrganizationName() {
|
||||
}
|
||||
|
||||
public OrganizationName(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class OrganizationalUnitName extends BerPrintableString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public OrganizationalUnitName() {
|
||||
}
|
||||
|
||||
public OrganizationalUnitName(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class OrganizationalUnitNames implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<OrganizationalUnitName> seqOf = null;
|
||||
|
||||
public OrganizationalUnitNames() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public OrganizationalUnitNames(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<OrganizationalUnitName> getOrganizationalUnitName() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(OrganizationalUnitName.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
OrganizationalUnitName element = new OrganizationalUnitName();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<OrganizationalUnitName> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PDSName extends BerPrintableString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public PDSName() {
|
||||
}
|
||||
|
||||
public PDSName(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,177 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PDSParameter implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerPrintableString printableString = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
|
||||
public PDSParameter() {
|
||||
}
|
||||
|
||||
public PDSParameter(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setPrintableString(BerPrintableString printableString) {
|
||||
this.printableString = printableString;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableString() {
|
||||
return printableString;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
codeLength += printableString.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
if (lengthVal == 0) {
|
||||
return tlByteCount;
|
||||
}
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableString = new BerPrintableString();
|
||||
vByteCount += printableString.decode(is, false);
|
||||
}
|
||||
else if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
vByteCount += teletexString.decode(is, false);
|
||||
}
|
||||
else if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match any set component: " + berTag);
|
||||
}
|
||||
}
|
||||
if (vByteCount != lengthVal) {
|
||||
throw new IOException("Length of set does not match length tag, length tag: " + lengthVal + ", actual set length: " + vByteCount);
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (printableString != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("printableString: ").append(printableString);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PersonalName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerPrintableString surname = null;
|
||||
private BerPrintableString givenName = null;
|
||||
private BerPrintableString initials = null;
|
||||
private BerPrintableString generationQualifier = null;
|
||||
|
||||
public PersonalName() {
|
||||
}
|
||||
|
||||
public PersonalName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setSurname(BerPrintableString surname) {
|
||||
this.surname = surname;
|
||||
}
|
||||
|
||||
public BerPrintableString getSurname() {
|
||||
return surname;
|
||||
}
|
||||
|
||||
public void setGivenName(BerPrintableString givenName) {
|
||||
this.givenName = givenName;
|
||||
}
|
||||
|
||||
public BerPrintableString getGivenName() {
|
||||
return givenName;
|
||||
}
|
||||
|
||||
public void setInitials(BerPrintableString initials) {
|
||||
this.initials = initials;
|
||||
}
|
||||
|
||||
public BerPrintableString getInitials() {
|
||||
return initials;
|
||||
}
|
||||
|
||||
public void setGenerationQualifier(BerPrintableString generationQualifier) {
|
||||
this.generationQualifier = generationQualifier;
|
||||
}
|
||||
|
||||
public BerPrintableString getGenerationQualifier() {
|
||||
return generationQualifier;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (generationQualifier != null) {
|
||||
codeLength += generationQualifier.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
|
||||
reverseOS.write(0x83);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (initials != null) {
|
||||
codeLength += initials.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
reverseOS.write(0x82);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (givenName != null) {
|
||||
codeLength += givenName.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += surname.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
surname = new BerPrintableString();
|
||||
vByteCount += surname.decode(is, false);
|
||||
}
|
||||
else if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
givenName = new BerPrintableString();
|
||||
vByteCount += givenName.decode(is, false);
|
||||
}
|
||||
else if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
initials = new BerPrintableString();
|
||||
vByteCount += initials.decode(is, false);
|
||||
}
|
||||
else if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
|
||||
generationQualifier = new BerPrintableString();
|
||||
vByteCount += generationQualifier.decode(is, false);
|
||||
}
|
||||
else if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match any set component: " + berTag);
|
||||
}
|
||||
}
|
||||
if (vByteCount != lengthVal) {
|
||||
throw new IOException("Length of set does not match length tag, length tag: " + lengthVal + ", actual set length: " + vByteCount);
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (surname != null) {
|
||||
sb.append("surname: ").append(surname);
|
||||
}
|
||||
else {
|
||||
sb.append("surname: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (givenName != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("givenName: ").append(givenName);
|
||||
}
|
||||
|
||||
if (initials != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("initials: ").append(initials);
|
||||
}
|
||||
|
||||
if (generationQualifier != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("generationQualifier: ").append(generationQualifier);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PhysicalDeliveryCountryName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerNumericString x121DccCode = null;
|
||||
private BerPrintableString iso3166Alpha2Code = null;
|
||||
|
||||
public PhysicalDeliveryCountryName() {
|
||||
}
|
||||
|
||||
public PhysicalDeliveryCountryName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setX121DccCode(BerNumericString x121DccCode) {
|
||||
this.x121DccCode = x121DccCode;
|
||||
}
|
||||
|
||||
public BerNumericString getX121DccCode() {
|
||||
return x121DccCode;
|
||||
}
|
||||
|
||||
public void setIso3166Alpha2Code(BerPrintableString iso3166Alpha2Code) {
|
||||
this.iso3166Alpha2Code = iso3166Alpha2Code;
|
||||
}
|
||||
|
||||
public BerPrintableString getIso3166Alpha2Code() {
|
||||
return iso3166Alpha2Code;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (iso3166Alpha2Code != null) {
|
||||
codeLength += iso3166Alpha2Code.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (x121DccCode != null) {
|
||||
codeLength += x121DccCode.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerNumericString.tag)) {
|
||||
x121DccCode = new BerNumericString();
|
||||
tlvByteCount += x121DccCode.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
iso3166Alpha2Code = new BerPrintableString();
|
||||
tlvByteCount += iso3166Alpha2Code.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (x121DccCode != null) {
|
||||
sb.append("x121DccCode: ").append(x121DccCode);
|
||||
return;
|
||||
}
|
||||
|
||||
if (iso3166Alpha2Code != null) {
|
||||
sb.append("iso3166Alpha2Code: ").append(iso3166Alpha2Code);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PhysicalDeliveryOfficeName extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public PhysicalDeliveryOfficeName() {
|
||||
}
|
||||
|
||||
public PhysicalDeliveryOfficeName(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PhysicalDeliveryOfficeNumber extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public PhysicalDeliveryOfficeNumber() {
|
||||
}
|
||||
|
||||
public PhysicalDeliveryOfficeNumber(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PhysicalDeliveryOrganizationName extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public PhysicalDeliveryOrganizationName() {
|
||||
}
|
||||
|
||||
public PhysicalDeliveryOrganizationName(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PhysicalDeliveryPersonalName extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public PhysicalDeliveryPersonalName() {
|
||||
}
|
||||
|
||||
public PhysicalDeliveryPersonalName(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PostOfficeBoxAddress extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public PostOfficeBoxAddress() {
|
||||
}
|
||||
|
||||
public PostOfficeBoxAddress(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PostalCode implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerNumericString numericCode = null;
|
||||
private BerPrintableString printableCode = null;
|
||||
|
||||
public PostalCode() {
|
||||
}
|
||||
|
||||
public PostalCode(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setNumericCode(BerNumericString numericCode) {
|
||||
this.numericCode = numericCode;
|
||||
}
|
||||
|
||||
public BerNumericString getNumericCode() {
|
||||
return numericCode;
|
||||
}
|
||||
|
||||
public void setPrintableCode(BerPrintableString printableCode) {
|
||||
this.printableCode = printableCode;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableCode() {
|
||||
return printableCode;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (printableCode != null) {
|
||||
codeLength += printableCode.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (numericCode != null) {
|
||||
codeLength += numericCode.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerNumericString.tag)) {
|
||||
numericCode = new BerNumericString();
|
||||
tlvByteCount += numericCode.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableCode = new BerPrintableString();
|
||||
tlvByteCount += printableCode.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (numericCode != null) {
|
||||
sb.append("numericCode: ").append(numericCode);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printableCode != null) {
|
||||
sb.append("printableCode: ").append(printableCode);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PosteRestanteAddress extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public PosteRestanteAddress() {
|
||||
}
|
||||
|
||||
public PosteRestanteAddress(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,405 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PresentationAddress implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class NAddresses implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17);
|
||||
private byte[] code = null;
|
||||
private List<BerOctetString> seqOf = null;
|
||||
|
||||
public NAddresses() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public NAddresses(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<BerOctetString> getBerOctetString() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(BerOctetString.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
BerOctetString element = new BerOctetString();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<BerOctetString> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerOctetString pSelector = null;
|
||||
private BerOctetString sSelector = null;
|
||||
private BerOctetString tSelector = null;
|
||||
private NAddresses nAddresses = null;
|
||||
|
||||
public PresentationAddress() {
|
||||
}
|
||||
|
||||
public PresentationAddress(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setPSelector(BerOctetString pSelector) {
|
||||
this.pSelector = pSelector;
|
||||
}
|
||||
|
||||
public BerOctetString getPSelector() {
|
||||
return pSelector;
|
||||
}
|
||||
|
||||
public void setSSelector(BerOctetString sSelector) {
|
||||
this.sSelector = sSelector;
|
||||
}
|
||||
|
||||
public BerOctetString getSSelector() {
|
||||
return sSelector;
|
||||
}
|
||||
|
||||
public void setTSelector(BerOctetString tSelector) {
|
||||
this.tSelector = tSelector;
|
||||
}
|
||||
|
||||
public BerOctetString getTSelector() {
|
||||
return tSelector;
|
||||
}
|
||||
|
||||
public void setNAddresses(NAddresses nAddresses) {
|
||||
this.nAddresses = nAddresses;
|
||||
}
|
||||
|
||||
public NAddresses getNAddresses() {
|
||||
return nAddresses;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
sublength = nAddresses.encode(reverseOS, true);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 3
|
||||
reverseOS.write(0xA3);
|
||||
codeLength += 1;
|
||||
|
||||
if (tSelector != null) {
|
||||
sublength = tSelector.encode(reverseOS, true);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
reverseOS.write(0xA2);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (sSelector != null) {
|
||||
sublength = sSelector.encode(reverseOS, true);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (pSelector != null) {
|
||||
sublength = pSelector.encode(reverseOS, true);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
vByteCount += length.decode(is);
|
||||
pSelector = new BerOctetString();
|
||||
vByteCount += pSelector.decode(is, true);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
vByteCount += length.decode(is);
|
||||
sSelector = new BerOctetString();
|
||||
vByteCount += sSelector.decode(is, true);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
vByteCount += length.decode(is);
|
||||
tSelector = new BerOctetString();
|
||||
vByteCount += tSelector.decode(is, true);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) {
|
||||
vByteCount += length.decode(is);
|
||||
nAddresses = new NAddresses();
|
||||
vByteCount += nAddresses.decode(is, true);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (pSelector != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("pSelector: ").append(pSelector);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (sSelector != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("sSelector: ").append(sSelector);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (tSelector != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("tSelector: ").append(tSelector);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (nAddresses != null) {
|
||||
sb.append("nAddresses: ");
|
||||
nAddresses.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("nAddresses: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class PrivateDomainName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerNumericString numeric = null;
|
||||
private BerPrintableString printable = null;
|
||||
|
||||
public PrivateDomainName() {
|
||||
}
|
||||
|
||||
public PrivateDomainName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setNumeric(BerNumericString numeric) {
|
||||
this.numeric = numeric;
|
||||
}
|
||||
|
||||
public BerNumericString getNumeric() {
|
||||
return numeric;
|
||||
}
|
||||
|
||||
public void setPrintable(BerPrintableString printable) {
|
||||
this.printable = printable;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintable() {
|
||||
return printable;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (printable != null) {
|
||||
codeLength += printable.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (numeric != null) {
|
||||
codeLength += numeric.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerNumericString.tag)) {
|
||||
numeric = new BerNumericString();
|
||||
tlvByteCount += numeric.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printable = new BerPrintableString();
|
||||
tlvByteCount += printable.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (numeric != null) {
|
||||
sb.append("numeric: ").append(numeric);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printable != null) {
|
||||
sb.append("printable: ").append(printable);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class RDNSequence implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<RelativeDistinguishedName> seqOf = null;
|
||||
|
||||
public RDNSequence() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public RDNSequence(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<RelativeDistinguishedName> getRelativeDistinguishedName() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(RelativeDistinguishedName.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
RelativeDistinguishedName element = new RelativeDistinguishedName();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<RelativeDistinguishedName> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class RelativeDistinguishedName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17);
|
||||
private byte[] code = null;
|
||||
private List<AttributeTypeAndValue> seqOf = null;
|
||||
|
||||
public RelativeDistinguishedName() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public RelativeDistinguishedName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<AttributeTypeAndValue> getAttributeTypeAndValue() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(AttributeTypeAndValue.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
AttributeTypeAndValue element = new AttributeTypeAndValue();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<AttributeTypeAndValue> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class StreetAddress extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public StreetAddress() {
|
||||
}
|
||||
|
||||
public StreetAddress(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class SubjectPublicKeyInfo implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private AlgorithmIdentifier algorithm = null;
|
||||
private BerBitString subjectPublicKey = null;
|
||||
|
||||
public SubjectPublicKeyInfo() {
|
||||
}
|
||||
|
||||
public SubjectPublicKeyInfo(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setAlgorithm(AlgorithmIdentifier algorithm) {
|
||||
this.algorithm = algorithm;
|
||||
}
|
||||
|
||||
public AlgorithmIdentifier getAlgorithm() {
|
||||
return algorithm;
|
||||
}
|
||||
|
||||
public void setSubjectPublicKey(BerBitString subjectPublicKey) {
|
||||
this.subjectPublicKey = subjectPublicKey;
|
||||
}
|
||||
|
||||
public BerBitString getSubjectPublicKey() {
|
||||
return subjectPublicKey;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += subjectPublicKey.encode(reverseOS, true);
|
||||
|
||||
codeLength += algorithm.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(AlgorithmIdentifier.tag)) {
|
||||
algorithm = new AlgorithmIdentifier();
|
||||
vByteCount += algorithm.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBitString.tag)) {
|
||||
subjectPublicKey = new BerBitString();
|
||||
vByteCount += subjectPublicKey.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (algorithm != null) {
|
||||
sb.append("algorithm: ");
|
||||
algorithm.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("algorithm: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (subjectPublicKey != null) {
|
||||
sb.append("subjectPublicKey: ").append(subjectPublicKey);
|
||||
}
|
||||
else {
|
||||
sb.append("subjectPublicKey: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,677 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TBSCertList implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class RevokedCertificates implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class SEQUENCE implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private CertificateSerialNumber userCertificate = null;
|
||||
private Time revocationDate = null;
|
||||
private Extensions crlEntryExtensions = null;
|
||||
|
||||
public SEQUENCE() {
|
||||
}
|
||||
|
||||
public SEQUENCE(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setUserCertificate(CertificateSerialNumber userCertificate) {
|
||||
this.userCertificate = userCertificate;
|
||||
}
|
||||
|
||||
public CertificateSerialNumber getUserCertificate() {
|
||||
return userCertificate;
|
||||
}
|
||||
|
||||
public void setRevocationDate(Time revocationDate) {
|
||||
this.revocationDate = revocationDate;
|
||||
}
|
||||
|
||||
public Time getRevocationDate() {
|
||||
return revocationDate;
|
||||
}
|
||||
|
||||
public void setCrlEntryExtensions(Extensions crlEntryExtensions) {
|
||||
this.crlEntryExtensions = crlEntryExtensions;
|
||||
}
|
||||
|
||||
public Extensions getCrlEntryExtensions() {
|
||||
return crlEntryExtensions;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (crlEntryExtensions != null) {
|
||||
codeLength += crlEntryExtensions.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += revocationDate.encode(reverseOS);
|
||||
|
||||
codeLength += userCertificate.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(CertificateSerialNumber.tag)) {
|
||||
userCertificate = new CertificateSerialNumber();
|
||||
vByteCount += userCertificate.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
revocationDate = new Time();
|
||||
numDecodedBytes = revocationDate.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
if (berTag.equals(Extensions.tag)) {
|
||||
crlEntryExtensions = new Extensions();
|
||||
vByteCount += crlEntryExtensions.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (userCertificate != null) {
|
||||
sb.append("userCertificate: ").append(userCertificate);
|
||||
}
|
||||
else {
|
||||
sb.append("userCertificate: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (revocationDate != null) {
|
||||
sb.append("revocationDate: ");
|
||||
revocationDate.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("revocationDate: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (crlEntryExtensions != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("crlEntryExtensions: ");
|
||||
crlEntryExtensions.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<SEQUENCE> seqOf = null;
|
||||
|
||||
public RevokedCertificates() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public RevokedCertificates(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<SEQUENCE> getSEQUENCE() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(SEQUENCE.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
SEQUENCE element = new SEQUENCE();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<SEQUENCE> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private Version version = null;
|
||||
private AlgorithmIdentifier signature = null;
|
||||
private Name issuer = null;
|
||||
private Time thisUpdate = null;
|
||||
private Time nextUpdate = null;
|
||||
private RevokedCertificates revokedCertificates = null;
|
||||
private Extensions crlExtensions = null;
|
||||
|
||||
public TBSCertList() {
|
||||
}
|
||||
|
||||
public TBSCertList(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVersion(Version version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Version getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setSignature(AlgorithmIdentifier signature) {
|
||||
this.signature = signature;
|
||||
}
|
||||
|
||||
public AlgorithmIdentifier getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
public void setIssuer(Name issuer) {
|
||||
this.issuer = issuer;
|
||||
}
|
||||
|
||||
public Name getIssuer() {
|
||||
return issuer;
|
||||
}
|
||||
|
||||
public void setThisUpdate(Time thisUpdate) {
|
||||
this.thisUpdate = thisUpdate;
|
||||
}
|
||||
|
||||
public Time getThisUpdate() {
|
||||
return thisUpdate;
|
||||
}
|
||||
|
||||
public void setNextUpdate(Time nextUpdate) {
|
||||
this.nextUpdate = nextUpdate;
|
||||
}
|
||||
|
||||
public Time getNextUpdate() {
|
||||
return nextUpdate;
|
||||
}
|
||||
|
||||
public void setRevokedCertificates(RevokedCertificates revokedCertificates) {
|
||||
this.revokedCertificates = revokedCertificates;
|
||||
}
|
||||
|
||||
public RevokedCertificates getRevokedCertificates() {
|
||||
return revokedCertificates;
|
||||
}
|
||||
|
||||
public void setCrlExtensions(Extensions crlExtensions) {
|
||||
this.crlExtensions = crlExtensions;
|
||||
}
|
||||
|
||||
public Extensions getCrlExtensions() {
|
||||
return crlExtensions;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (crlExtensions != null) {
|
||||
sublength = crlExtensions.encode(reverseOS, true);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (revokedCertificates != null) {
|
||||
codeLength += revokedCertificates.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
if (nextUpdate != null) {
|
||||
codeLength += nextUpdate.encode(reverseOS);
|
||||
}
|
||||
|
||||
codeLength += thisUpdate.encode(reverseOS);
|
||||
|
||||
codeLength += issuer.encode(reverseOS);
|
||||
|
||||
codeLength += signature.encode(reverseOS, true);
|
||||
|
||||
if (version != null) {
|
||||
codeLength += version.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(Version.tag)) {
|
||||
version = new Version();
|
||||
vByteCount += version.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(AlgorithmIdentifier.tag)) {
|
||||
signature = new AlgorithmIdentifier();
|
||||
vByteCount += signature.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
issuer = new Name();
|
||||
numDecodedBytes = issuer.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
thisUpdate = new Time();
|
||||
numDecodedBytes = thisUpdate.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
nextUpdate = new Time();
|
||||
numDecodedBytes = nextUpdate.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
nextUpdate = null;
|
||||
}
|
||||
if (berTag.equals(RevokedCertificates.tag)) {
|
||||
revokedCertificates = new RevokedCertificates();
|
||||
vByteCount += revokedCertificates.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
vByteCount += length.decode(is);
|
||||
crlExtensions = new Extensions();
|
||||
vByteCount += crlExtensions.decode(is, true);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (version != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("version: ").append(version);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (signature != null) {
|
||||
sb.append("signature: ");
|
||||
signature.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("signature: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (issuer != null) {
|
||||
sb.append("issuer: ");
|
||||
issuer.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("issuer: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (thisUpdate != null) {
|
||||
sb.append("thisUpdate: ");
|
||||
thisUpdate.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("thisUpdate: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (nextUpdate != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("nextUpdate: ");
|
||||
nextUpdate.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
if (revokedCertificates != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("revokedCertificates: ");
|
||||
revokedCertificates.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
if (crlExtensions != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("crlExtensions: ");
|
||||
crlExtensions.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,455 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TBSCertificate implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private Version version = null;
|
||||
private CertificateSerialNumber serialNumber = null;
|
||||
private AlgorithmIdentifier signature = null;
|
||||
private Name issuer = null;
|
||||
private Validity validity = null;
|
||||
private Name subject = null;
|
||||
private SubjectPublicKeyInfo subjectPublicKeyInfo = null;
|
||||
private UniqueIdentifier issuerUniqueID = null;
|
||||
private UniqueIdentifier subjectUniqueID = null;
|
||||
private Extensions extensions = null;
|
||||
|
||||
public TBSCertificate() {
|
||||
}
|
||||
|
||||
public TBSCertificate(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setVersion(Version version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Version getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setSerialNumber(CertificateSerialNumber serialNumber) {
|
||||
this.serialNumber = serialNumber;
|
||||
}
|
||||
|
||||
public CertificateSerialNumber getSerialNumber() {
|
||||
return serialNumber;
|
||||
}
|
||||
|
||||
public void setSignature(AlgorithmIdentifier signature) {
|
||||
this.signature = signature;
|
||||
}
|
||||
|
||||
public AlgorithmIdentifier getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
public void setIssuer(Name issuer) {
|
||||
this.issuer = issuer;
|
||||
}
|
||||
|
||||
public Name getIssuer() {
|
||||
return issuer;
|
||||
}
|
||||
|
||||
public void setValidity(Validity validity) {
|
||||
this.validity = validity;
|
||||
}
|
||||
|
||||
public Validity getValidity() {
|
||||
return validity;
|
||||
}
|
||||
|
||||
public void setSubject(Name subject) {
|
||||
this.subject = subject;
|
||||
}
|
||||
|
||||
public Name getSubject() {
|
||||
return subject;
|
||||
}
|
||||
|
||||
public void setSubjectPublicKeyInfo(SubjectPublicKeyInfo subjectPublicKeyInfo) {
|
||||
this.subjectPublicKeyInfo = subjectPublicKeyInfo;
|
||||
}
|
||||
|
||||
public SubjectPublicKeyInfo getSubjectPublicKeyInfo() {
|
||||
return subjectPublicKeyInfo;
|
||||
}
|
||||
|
||||
public void setIssuerUniqueID(UniqueIdentifier issuerUniqueID) {
|
||||
this.issuerUniqueID = issuerUniqueID;
|
||||
}
|
||||
|
||||
public UniqueIdentifier getIssuerUniqueID() {
|
||||
return issuerUniqueID;
|
||||
}
|
||||
|
||||
public void setSubjectUniqueID(UniqueIdentifier subjectUniqueID) {
|
||||
this.subjectUniqueID = subjectUniqueID;
|
||||
}
|
||||
|
||||
public UniqueIdentifier getSubjectUniqueID() {
|
||||
return subjectUniqueID;
|
||||
}
|
||||
|
||||
public void setExtensions(Extensions extensions) {
|
||||
this.extensions = extensions;
|
||||
}
|
||||
|
||||
public Extensions getExtensions() {
|
||||
return extensions;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (extensions != null) {
|
||||
sublength = extensions.encode(reverseOS, true);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 3
|
||||
reverseOS.write(0xA3);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (subjectUniqueID != null) {
|
||||
codeLength += subjectUniqueID.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
reverseOS.write(0x82);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (issuerUniqueID != null) {
|
||||
codeLength += issuerUniqueID.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += subjectPublicKeyInfo.encode(reverseOS, true);
|
||||
|
||||
codeLength += subject.encode(reverseOS);
|
||||
|
||||
codeLength += validity.encode(reverseOS, true);
|
||||
|
||||
codeLength += issuer.encode(reverseOS);
|
||||
|
||||
codeLength += signature.encode(reverseOS, true);
|
||||
|
||||
codeLength += serialNumber.encode(reverseOS, true);
|
||||
|
||||
if (version != null) {
|
||||
sublength = version.encode(reverseOS, true);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
vByteCount += length.decode(is);
|
||||
version = new Version();
|
||||
vByteCount += version.decode(is, true);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(CertificateSerialNumber.tag)) {
|
||||
serialNumber = new CertificateSerialNumber();
|
||||
vByteCount += serialNumber.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(AlgorithmIdentifier.tag)) {
|
||||
signature = new AlgorithmIdentifier();
|
||||
vByteCount += signature.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
issuer = new Name();
|
||||
numDecodedBytes = issuer.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
if (berTag.equals(Validity.tag)) {
|
||||
validity = new Validity();
|
||||
vByteCount += validity.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
subject = new Name();
|
||||
numDecodedBytes = subject.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
if (berTag.equals(SubjectPublicKeyInfo.tag)) {
|
||||
subjectPublicKeyInfo = new SubjectPublicKeyInfo();
|
||||
vByteCount += subjectPublicKeyInfo.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
issuerUniqueID = new UniqueIdentifier();
|
||||
vByteCount += issuerUniqueID.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
subjectUniqueID = new UniqueIdentifier();
|
||||
vByteCount += subjectUniqueID.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) {
|
||||
vByteCount += length.decode(is);
|
||||
extensions = new Extensions();
|
||||
vByteCount += extensions.decode(is, true);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (version != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("version: ").append(version);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (serialNumber != null) {
|
||||
sb.append("serialNumber: ").append(serialNumber);
|
||||
}
|
||||
else {
|
||||
sb.append("serialNumber: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (signature != null) {
|
||||
sb.append("signature: ");
|
||||
signature.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("signature: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (issuer != null) {
|
||||
sb.append("issuer: ");
|
||||
issuer.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("issuer: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (validity != null) {
|
||||
sb.append("validity: ");
|
||||
validity.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("validity: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (subject != null) {
|
||||
sb.append("subject: ");
|
||||
subject.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("subject: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (subjectPublicKeyInfo != null) {
|
||||
sb.append("subjectPublicKeyInfo: ");
|
||||
subjectPublicKeyInfo.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("subjectPublicKeyInfo: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (issuerUniqueID != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("issuerUniqueID: ").append(issuerUniqueID);
|
||||
}
|
||||
|
||||
if (subjectUniqueID != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("subjectUniqueID: ").append(subjectUniqueID);
|
||||
}
|
||||
|
||||
if (extensions != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("extensions: ");
|
||||
extensions.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TeletexCommonName extends BerTeletexString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TeletexCommonName() {
|
||||
}
|
||||
|
||||
public TeletexCommonName(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TeletexDomainDefinedAttribute implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString type = null;
|
||||
private BerTeletexString value = null;
|
||||
|
||||
public TeletexDomainDefinedAttribute() {
|
||||
}
|
||||
|
||||
public TeletexDomainDefinedAttribute(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setType(BerTeletexString type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public BerTeletexString getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setValue(BerTeletexString value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public BerTeletexString getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += value.encode(reverseOS, true);
|
||||
|
||||
codeLength += type.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
type = new BerTeletexString();
|
||||
vByteCount += type.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
value = new BerTeletexString();
|
||||
vByteCount += value.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (type != null) {
|
||||
sb.append("type: ").append(type);
|
||||
}
|
||||
else {
|
||||
sb.append("type: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (value != null) {
|
||||
sb.append("value: ").append(value);
|
||||
}
|
||||
else {
|
||||
sb.append("value: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TeletexDomainDefinedAttributes implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<TeletexDomainDefinedAttribute> seqOf = null;
|
||||
|
||||
public TeletexDomainDefinedAttributes() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public TeletexDomainDefinedAttributes(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<TeletexDomainDefinedAttribute> getTeletexDomainDefinedAttribute() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(TeletexDomainDefinedAttribute.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
TeletexDomainDefinedAttribute element = new TeletexDomainDefinedAttribute();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<TeletexDomainDefinedAttribute> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TeletexOrganizationName extends BerTeletexString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TeletexOrganizationName() {
|
||||
}
|
||||
|
||||
public TeletexOrganizationName(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TeletexOrganizationalUnitName extends BerTeletexString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TeletexOrganizationalUnitName() {
|
||||
}
|
||||
|
||||
public TeletexOrganizationalUnitName(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TeletexOrganizationalUnitNames implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<TeletexOrganizationalUnitName> seqOf = null;
|
||||
|
||||
public TeletexOrganizationalUnitNames() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public TeletexOrganizationalUnitNames(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<TeletexOrganizationalUnitName> getTeletexOrganizationalUnitName() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(TeletexOrganizationalUnitName.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
TeletexOrganizationalUnitName element = new TeletexOrganizationalUnitName();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<TeletexOrganizationalUnitName> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TeletexPersonalName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString surname = null;
|
||||
private BerTeletexString givenName = null;
|
||||
private BerTeletexString initials = null;
|
||||
private BerTeletexString generationQualifier = null;
|
||||
|
||||
public TeletexPersonalName() {
|
||||
}
|
||||
|
||||
public TeletexPersonalName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setSurname(BerTeletexString surname) {
|
||||
this.surname = surname;
|
||||
}
|
||||
|
||||
public BerTeletexString getSurname() {
|
||||
return surname;
|
||||
}
|
||||
|
||||
public void setGivenName(BerTeletexString givenName) {
|
||||
this.givenName = givenName;
|
||||
}
|
||||
|
||||
public BerTeletexString getGivenName() {
|
||||
return givenName;
|
||||
}
|
||||
|
||||
public void setInitials(BerTeletexString initials) {
|
||||
this.initials = initials;
|
||||
}
|
||||
|
||||
public BerTeletexString getInitials() {
|
||||
return initials;
|
||||
}
|
||||
|
||||
public void setGenerationQualifier(BerTeletexString generationQualifier) {
|
||||
this.generationQualifier = generationQualifier;
|
||||
}
|
||||
|
||||
public BerTeletexString getGenerationQualifier() {
|
||||
return generationQualifier;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (generationQualifier != null) {
|
||||
codeLength += generationQualifier.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 3
|
||||
reverseOS.write(0x83);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (initials != null) {
|
||||
codeLength += initials.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
reverseOS.write(0x82);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (givenName != null) {
|
||||
codeLength += givenName.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += surname.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
surname = new BerTeletexString();
|
||||
vByteCount += surname.decode(is, false);
|
||||
}
|
||||
else if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
givenName = new BerTeletexString();
|
||||
vByteCount += givenName.decode(is, false);
|
||||
}
|
||||
else if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
initials = new BerTeletexString();
|
||||
vByteCount += initials.decode(is, false);
|
||||
}
|
||||
else if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
|
||||
generationQualifier = new BerTeletexString();
|
||||
vByteCount += generationQualifier.decode(is, false);
|
||||
}
|
||||
else if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match any set component: " + berTag);
|
||||
}
|
||||
}
|
||||
if (vByteCount != lengthVal) {
|
||||
throw new IOException("Length of set does not match length tag, length tag: " + lengthVal + ", actual set length: " + vByteCount);
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (surname != null) {
|
||||
sb.append("surname: ").append(surname);
|
||||
}
|
||||
else {
|
||||
sb.append("surname: <empty-required-field>");
|
||||
}
|
||||
|
||||
if (givenName != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("givenName: ").append(givenName);
|
||||
}
|
||||
|
||||
if (initials != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("initials: ").append(initials);
|
||||
}
|
||||
|
||||
if (generationQualifier != null) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("generationQualifier: ").append(generationQualifier);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TerminalIdentifier extends BerPrintableString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TerminalIdentifier() {
|
||||
}
|
||||
|
||||
public TerminalIdentifier(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class TerminalType extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TerminalType() {
|
||||
}
|
||||
|
||||
public TerminalType(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public TerminalType(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public TerminalType(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class Time implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerUtcTime utcTime = null;
|
||||
private BerGeneralizedTime generalTime = null;
|
||||
|
||||
public Time() {
|
||||
}
|
||||
|
||||
public Time(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setUtcTime(BerUtcTime utcTime) {
|
||||
this.utcTime = utcTime;
|
||||
}
|
||||
|
||||
public BerUtcTime getUtcTime() {
|
||||
return utcTime;
|
||||
}
|
||||
|
||||
public void setGeneralTime(BerGeneralizedTime generalTime) {
|
||||
this.generalTime = generalTime;
|
||||
}
|
||||
|
||||
public BerGeneralizedTime getGeneralTime() {
|
||||
return generalTime;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (generalTime != null) {
|
||||
codeLength += generalTime.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (utcTime != null) {
|
||||
codeLength += utcTime.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUtcTime.tag)) {
|
||||
utcTime = new BerUtcTime();
|
||||
tlvByteCount += utcTime.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerGeneralizedTime.tag)) {
|
||||
generalTime = new BerGeneralizedTime();
|
||||
tlvByteCount += generalTime.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (utcTime != null) {
|
||||
sb.append("utcTime: ").append(utcTime);
|
||||
return;
|
||||
}
|
||||
|
||||
if (generalTime != null) {
|
||||
sb.append("generalTime: ").append(generalTime);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,311 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class UnformattedPostalAddress implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static class PrintableAddress implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<BerPrintableString> seqOf = null;
|
||||
|
||||
public PrintableAddress() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public PrintableAddress(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<BerPrintableString> getBerPrintableString() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(BerPrintableString.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
BerPrintableString element = new BerPrintableString();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<BerPrintableString> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 17);
|
||||
|
||||
private byte[] code = null;
|
||||
private PrintableAddress printableAddress = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
|
||||
public UnformattedPostalAddress() {
|
||||
}
|
||||
|
||||
public UnformattedPostalAddress(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setPrintableAddress(PrintableAddress printableAddress) {
|
||||
this.printableAddress = printableAddress;
|
||||
}
|
||||
|
||||
public PrintableAddress getPrintableAddress() {
|
||||
return printableAddress;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
if (printableAddress != null) {
|
||||
codeLength += printableAddress.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
if (lengthVal == 0) {
|
||||
return tlByteCount;
|
||||
}
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
if (berTag.equals(PrintableAddress.tag)) {
|
||||
printableAddress = new PrintableAddress();
|
||||
vByteCount += printableAddress.decode(is, false);
|
||||
}
|
||||
else if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
vByteCount += teletexString.decode(is, false);
|
||||
}
|
||||
else if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match any set component: " + berTag);
|
||||
}
|
||||
}
|
||||
if (vByteCount != lengthVal) {
|
||||
throw new IOException("Length of set does not match length tag, length tag: " + lengthVal + ", actual set length: " + vByteCount);
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (printableAddress != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("printableAddress: ");
|
||||
printableAddress.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class UniqueIdentifier extends BerBitString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public UniqueIdentifier() {
|
||||
}
|
||||
|
||||
public UniqueIdentifier(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public UniqueIdentifier(byte[] value, int numBits) {
|
||||
super(value, numBits);
|
||||
}
|
||||
|
||||
public UniqueIdentifier(boolean[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class UniquePostalName extends PDSParameter {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public UniquePostalName() {
|
||||
}
|
||||
|
||||
public UniquePostalName(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,184 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class Validity implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private Time notBefore = null;
|
||||
private Time notAfter = null;
|
||||
|
||||
public Validity() {
|
||||
}
|
||||
|
||||
public Validity(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setNotBefore(Time notBefore) {
|
||||
this.notBefore = notBefore;
|
||||
}
|
||||
|
||||
public Time getNotBefore() {
|
||||
return notBefore;
|
||||
}
|
||||
|
||||
public void setNotAfter(Time notAfter) {
|
||||
this.notAfter = notAfter;
|
||||
}
|
||||
|
||||
public Time getNotAfter() {
|
||||
return notAfter;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += notAfter.encode(reverseOS);
|
||||
|
||||
codeLength += notBefore.encode(reverseOS);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
notBefore = new Time();
|
||||
numDecodedBytes = notBefore.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
notAfter = new Time();
|
||||
numDecodedBytes = notAfter.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (notBefore != null) {
|
||||
sb.append("notBefore: ");
|
||||
notBefore.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("notBefore: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (notAfter != null) {
|
||||
sb.append("notAfter: ");
|
||||
notAfter.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("notAfter: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class Version extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Version() {
|
||||
}
|
||||
|
||||
public Version(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public Version(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public Version(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X121Address extends BerNumericString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public X121Address() {
|
||||
}
|
||||
|
||||
public X121Address(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520CommonName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
private BerPrintableString printableString = null;
|
||||
private BerUniversalString universalString = null;
|
||||
private BerUTF8String utf8String = null;
|
||||
private BerBMPString bmpString = null;
|
||||
|
||||
public X520CommonName() {
|
||||
}
|
||||
|
||||
public X520CommonName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
public void setPrintableString(BerPrintableString printableString) {
|
||||
this.printableString = printableString;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableString() {
|
||||
return printableString;
|
||||
}
|
||||
|
||||
public void setUniversalString(BerUniversalString universalString) {
|
||||
this.universalString = universalString;
|
||||
}
|
||||
|
||||
public BerUniversalString getUniversalString() {
|
||||
return universalString;
|
||||
}
|
||||
|
||||
public void setUtf8String(BerUTF8String utf8String) {
|
||||
this.utf8String = utf8String;
|
||||
}
|
||||
|
||||
public BerUTF8String getUtf8String() {
|
||||
return utf8String;
|
||||
}
|
||||
|
||||
public void setBmpString(BerBMPString bmpString) {
|
||||
this.bmpString = bmpString;
|
||||
}
|
||||
|
||||
public BerBMPString getBmpString() {
|
||||
return bmpString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (bmpString != null) {
|
||||
codeLength += bmpString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
codeLength += utf8String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
codeLength += universalString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
codeLength += printableString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
tlvByteCount += teletexString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableString = new BerPrintableString();
|
||||
tlvByteCount += printableString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUniversalString.tag)) {
|
||||
universalString = new BerUniversalString();
|
||||
tlvByteCount += universalString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUTF8String.tag)) {
|
||||
utf8String = new BerUTF8String();
|
||||
tlvByteCount += utf8String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBMPString.tag)) {
|
||||
bmpString = new BerBMPString();
|
||||
tlvByteCount += bmpString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (teletexString != null) {
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
sb.append("printableString: ").append(printableString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
sb.append("universalString: ").append(universalString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
sb.append("utf8String: ").append(utf8String);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
sb.append("bmpString: ").append(bmpString);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520LocalityName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
private BerPrintableString printableString = null;
|
||||
private BerUniversalString universalString = null;
|
||||
private BerUTF8String utf8String = null;
|
||||
private BerBMPString bmpString = null;
|
||||
|
||||
public X520LocalityName() {
|
||||
}
|
||||
|
||||
public X520LocalityName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
public void setPrintableString(BerPrintableString printableString) {
|
||||
this.printableString = printableString;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableString() {
|
||||
return printableString;
|
||||
}
|
||||
|
||||
public void setUniversalString(BerUniversalString universalString) {
|
||||
this.universalString = universalString;
|
||||
}
|
||||
|
||||
public BerUniversalString getUniversalString() {
|
||||
return universalString;
|
||||
}
|
||||
|
||||
public void setUtf8String(BerUTF8String utf8String) {
|
||||
this.utf8String = utf8String;
|
||||
}
|
||||
|
||||
public BerUTF8String getUtf8String() {
|
||||
return utf8String;
|
||||
}
|
||||
|
||||
public void setBmpString(BerBMPString bmpString) {
|
||||
this.bmpString = bmpString;
|
||||
}
|
||||
|
||||
public BerBMPString getBmpString() {
|
||||
return bmpString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (bmpString != null) {
|
||||
codeLength += bmpString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
codeLength += utf8String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
codeLength += universalString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
codeLength += printableString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
tlvByteCount += teletexString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableString = new BerPrintableString();
|
||||
tlvByteCount += printableString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUniversalString.tag)) {
|
||||
universalString = new BerUniversalString();
|
||||
tlvByteCount += universalString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUTF8String.tag)) {
|
||||
utf8String = new BerUTF8String();
|
||||
tlvByteCount += utf8String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBMPString.tag)) {
|
||||
bmpString = new BerBMPString();
|
||||
tlvByteCount += bmpString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (teletexString != null) {
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
sb.append("printableString: ").append(printableString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
sb.append("universalString: ").append(universalString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
sb.append("utf8String: ").append(utf8String);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
sb.append("bmpString: ").append(bmpString);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520OrganizationName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
private BerPrintableString printableString = null;
|
||||
private BerUniversalString universalString = null;
|
||||
private BerUTF8String utf8String = null;
|
||||
private BerBMPString bmpString = null;
|
||||
|
||||
public X520OrganizationName() {
|
||||
}
|
||||
|
||||
public X520OrganizationName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
public void setPrintableString(BerPrintableString printableString) {
|
||||
this.printableString = printableString;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableString() {
|
||||
return printableString;
|
||||
}
|
||||
|
||||
public void setUniversalString(BerUniversalString universalString) {
|
||||
this.universalString = universalString;
|
||||
}
|
||||
|
||||
public BerUniversalString getUniversalString() {
|
||||
return universalString;
|
||||
}
|
||||
|
||||
public void setUtf8String(BerUTF8String utf8String) {
|
||||
this.utf8String = utf8String;
|
||||
}
|
||||
|
||||
public BerUTF8String getUtf8String() {
|
||||
return utf8String;
|
||||
}
|
||||
|
||||
public void setBmpString(BerBMPString bmpString) {
|
||||
this.bmpString = bmpString;
|
||||
}
|
||||
|
||||
public BerBMPString getBmpString() {
|
||||
return bmpString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (bmpString != null) {
|
||||
codeLength += bmpString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
codeLength += utf8String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
codeLength += universalString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
codeLength += printableString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
tlvByteCount += teletexString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableString = new BerPrintableString();
|
||||
tlvByteCount += printableString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUniversalString.tag)) {
|
||||
universalString = new BerUniversalString();
|
||||
tlvByteCount += universalString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUTF8String.tag)) {
|
||||
utf8String = new BerUTF8String();
|
||||
tlvByteCount += utf8String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBMPString.tag)) {
|
||||
bmpString = new BerBMPString();
|
||||
tlvByteCount += bmpString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (teletexString != null) {
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
sb.append("printableString: ").append(printableString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
sb.append("universalString: ").append(universalString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
sb.append("utf8String: ").append(utf8String);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
sb.append("bmpString: ").append(bmpString);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520OrganizationalUnitName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
private BerPrintableString printableString = null;
|
||||
private BerUniversalString universalString = null;
|
||||
private BerUTF8String utf8String = null;
|
||||
private BerBMPString bmpString = null;
|
||||
|
||||
public X520OrganizationalUnitName() {
|
||||
}
|
||||
|
||||
public X520OrganizationalUnitName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
public void setPrintableString(BerPrintableString printableString) {
|
||||
this.printableString = printableString;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableString() {
|
||||
return printableString;
|
||||
}
|
||||
|
||||
public void setUniversalString(BerUniversalString universalString) {
|
||||
this.universalString = universalString;
|
||||
}
|
||||
|
||||
public BerUniversalString getUniversalString() {
|
||||
return universalString;
|
||||
}
|
||||
|
||||
public void setUtf8String(BerUTF8String utf8String) {
|
||||
this.utf8String = utf8String;
|
||||
}
|
||||
|
||||
public BerUTF8String getUtf8String() {
|
||||
return utf8String;
|
||||
}
|
||||
|
||||
public void setBmpString(BerBMPString bmpString) {
|
||||
this.bmpString = bmpString;
|
||||
}
|
||||
|
||||
public BerBMPString getBmpString() {
|
||||
return bmpString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (bmpString != null) {
|
||||
codeLength += bmpString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
codeLength += utf8String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
codeLength += universalString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
codeLength += printableString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
tlvByteCount += teletexString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableString = new BerPrintableString();
|
||||
tlvByteCount += printableString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUniversalString.tag)) {
|
||||
universalString = new BerUniversalString();
|
||||
tlvByteCount += universalString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUTF8String.tag)) {
|
||||
utf8String = new BerUTF8String();
|
||||
tlvByteCount += utf8String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBMPString.tag)) {
|
||||
bmpString = new BerBMPString();
|
||||
tlvByteCount += bmpString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (teletexString != null) {
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
sb.append("printableString: ").append(printableString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
sb.append("universalString: ").append(universalString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
sb.append("utf8String: ").append(utf8String);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
sb.append("bmpString: ").append(bmpString);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520Pseudonym implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
private BerPrintableString printableString = null;
|
||||
private BerUniversalString universalString = null;
|
||||
private BerUTF8String utf8String = null;
|
||||
private BerBMPString bmpString = null;
|
||||
|
||||
public X520Pseudonym() {
|
||||
}
|
||||
|
||||
public X520Pseudonym(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
public void setPrintableString(BerPrintableString printableString) {
|
||||
this.printableString = printableString;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableString() {
|
||||
return printableString;
|
||||
}
|
||||
|
||||
public void setUniversalString(BerUniversalString universalString) {
|
||||
this.universalString = universalString;
|
||||
}
|
||||
|
||||
public BerUniversalString getUniversalString() {
|
||||
return universalString;
|
||||
}
|
||||
|
||||
public void setUtf8String(BerUTF8String utf8String) {
|
||||
this.utf8String = utf8String;
|
||||
}
|
||||
|
||||
public BerUTF8String getUtf8String() {
|
||||
return utf8String;
|
||||
}
|
||||
|
||||
public void setBmpString(BerBMPString bmpString) {
|
||||
this.bmpString = bmpString;
|
||||
}
|
||||
|
||||
public BerBMPString getBmpString() {
|
||||
return bmpString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (bmpString != null) {
|
||||
codeLength += bmpString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
codeLength += utf8String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
codeLength += universalString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
codeLength += printableString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
tlvByteCount += teletexString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableString = new BerPrintableString();
|
||||
tlvByteCount += printableString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUniversalString.tag)) {
|
||||
universalString = new BerUniversalString();
|
||||
tlvByteCount += universalString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUTF8String.tag)) {
|
||||
utf8String = new BerUTF8String();
|
||||
tlvByteCount += utf8String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBMPString.tag)) {
|
||||
bmpString = new BerBMPString();
|
||||
tlvByteCount += bmpString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (teletexString != null) {
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
sb.append("printableString: ").append(printableString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
sb.append("universalString: ").append(universalString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
sb.append("utf8String: ").append(utf8String);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
sb.append("bmpString: ").append(bmpString);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520SerialNumber extends BerPrintableString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public X520SerialNumber() {
|
||||
}
|
||||
|
||||
public X520SerialNumber(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520StateOrProvinceName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
private BerPrintableString printableString = null;
|
||||
private BerUniversalString universalString = null;
|
||||
private BerUTF8String utf8String = null;
|
||||
private BerBMPString bmpString = null;
|
||||
|
||||
public X520StateOrProvinceName() {
|
||||
}
|
||||
|
||||
public X520StateOrProvinceName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
public void setPrintableString(BerPrintableString printableString) {
|
||||
this.printableString = printableString;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableString() {
|
||||
return printableString;
|
||||
}
|
||||
|
||||
public void setUniversalString(BerUniversalString universalString) {
|
||||
this.universalString = universalString;
|
||||
}
|
||||
|
||||
public BerUniversalString getUniversalString() {
|
||||
return universalString;
|
||||
}
|
||||
|
||||
public void setUtf8String(BerUTF8String utf8String) {
|
||||
this.utf8String = utf8String;
|
||||
}
|
||||
|
||||
public BerUTF8String getUtf8String() {
|
||||
return utf8String;
|
||||
}
|
||||
|
||||
public void setBmpString(BerBMPString bmpString) {
|
||||
this.bmpString = bmpString;
|
||||
}
|
||||
|
||||
public BerBMPString getBmpString() {
|
||||
return bmpString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (bmpString != null) {
|
||||
codeLength += bmpString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
codeLength += utf8String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
codeLength += universalString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
codeLength += printableString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
tlvByteCount += teletexString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableString = new BerPrintableString();
|
||||
tlvByteCount += printableString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUniversalString.tag)) {
|
||||
universalString = new BerUniversalString();
|
||||
tlvByteCount += universalString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUTF8String.tag)) {
|
||||
utf8String = new BerUTF8String();
|
||||
tlvByteCount += utf8String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBMPString.tag)) {
|
||||
bmpString = new BerBMPString();
|
||||
tlvByteCount += bmpString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (teletexString != null) {
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
sb.append("printableString: ").append(printableString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
sb.append("universalString: ").append(universalString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
sb.append("utf8String: ").append(utf8String);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
sb.append("bmpString: ").append(bmpString);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520Title implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
private BerPrintableString printableString = null;
|
||||
private BerUniversalString universalString = null;
|
||||
private BerUTF8String utf8String = null;
|
||||
private BerBMPString bmpString = null;
|
||||
|
||||
public X520Title() {
|
||||
}
|
||||
|
||||
public X520Title(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
public void setPrintableString(BerPrintableString printableString) {
|
||||
this.printableString = printableString;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableString() {
|
||||
return printableString;
|
||||
}
|
||||
|
||||
public void setUniversalString(BerUniversalString universalString) {
|
||||
this.universalString = universalString;
|
||||
}
|
||||
|
||||
public BerUniversalString getUniversalString() {
|
||||
return universalString;
|
||||
}
|
||||
|
||||
public void setUtf8String(BerUTF8String utf8String) {
|
||||
this.utf8String = utf8String;
|
||||
}
|
||||
|
||||
public BerUTF8String getUtf8String() {
|
||||
return utf8String;
|
||||
}
|
||||
|
||||
public void setBmpString(BerBMPString bmpString) {
|
||||
this.bmpString = bmpString;
|
||||
}
|
||||
|
||||
public BerBMPString getBmpString() {
|
||||
return bmpString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (bmpString != null) {
|
||||
codeLength += bmpString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
codeLength += utf8String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
codeLength += universalString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
codeLength += printableString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
tlvByteCount += teletexString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableString = new BerPrintableString();
|
||||
tlvByteCount += printableString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUniversalString.tag)) {
|
||||
universalString = new BerUniversalString();
|
||||
tlvByteCount += universalString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUTF8String.tag)) {
|
||||
utf8String = new BerUTF8String();
|
||||
tlvByteCount += utf8String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBMPString.tag)) {
|
||||
bmpString = new BerBMPString();
|
||||
tlvByteCount += bmpString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (teletexString != null) {
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
sb.append("printableString: ").append(printableString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
sb.append("universalString: ").append(universalString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
sb.append("utf8String: ").append(utf8String);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
sb.append("bmpString: ").append(bmpString);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520countryName extends BerPrintableString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public X520countryName() {
|
||||
}
|
||||
|
||||
public X520countryName(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520dnQualifier extends BerPrintableString {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public X520dnQualifier() {
|
||||
}
|
||||
|
||||
public X520dnQualifier(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1explicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
|
||||
public class X520name implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerTeletexString teletexString = null;
|
||||
private BerPrintableString printableString = null;
|
||||
private BerUniversalString universalString = null;
|
||||
private BerUTF8String utf8String = null;
|
||||
private BerBMPString bmpString = null;
|
||||
|
||||
public X520name() {
|
||||
}
|
||||
|
||||
public X520name(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTeletexString(BerTeletexString teletexString) {
|
||||
this.teletexString = teletexString;
|
||||
}
|
||||
|
||||
public BerTeletexString getTeletexString() {
|
||||
return teletexString;
|
||||
}
|
||||
|
||||
public void setPrintableString(BerPrintableString printableString) {
|
||||
this.printableString = printableString;
|
||||
}
|
||||
|
||||
public BerPrintableString getPrintableString() {
|
||||
return printableString;
|
||||
}
|
||||
|
||||
public void setUniversalString(BerUniversalString universalString) {
|
||||
this.universalString = universalString;
|
||||
}
|
||||
|
||||
public BerUniversalString getUniversalString() {
|
||||
return universalString;
|
||||
}
|
||||
|
||||
public void setUtf8String(BerUTF8String utf8String) {
|
||||
this.utf8String = utf8String;
|
||||
}
|
||||
|
||||
public BerUTF8String getUtf8String() {
|
||||
return utf8String;
|
||||
}
|
||||
|
||||
public void setBmpString(BerBMPString bmpString) {
|
||||
this.bmpString = bmpString;
|
||||
}
|
||||
|
||||
public BerBMPString getBmpString() {
|
||||
return bmpString;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (bmpString != null) {
|
||||
codeLength += bmpString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
codeLength += utf8String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
codeLength += universalString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
codeLength += printableString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (teletexString != null) {
|
||||
codeLength += teletexString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTeletexString.tag)) {
|
||||
teletexString = new BerTeletexString();
|
||||
tlvByteCount += teletexString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerPrintableString.tag)) {
|
||||
printableString = new BerPrintableString();
|
||||
tlvByteCount += printableString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUniversalString.tag)) {
|
||||
universalString = new BerUniversalString();
|
||||
tlvByteCount += universalString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUTF8String.tag)) {
|
||||
utf8String = new BerUTF8String();
|
||||
tlvByteCount += utf8String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBMPString.tag)) {
|
||||
bmpString = new BerBMPString();
|
||||
tlvByteCount += bmpString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (teletexString != null) {
|
||||
sb.append("teletexString: ").append(teletexString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (printableString != null) {
|
||||
sb.append("printableString: ").append(printableString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (universalString != null) {
|
||||
sb.append("universalString: ").append(universalString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
sb.append("utf8String: ").append(utf8String);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
sb.append("bmpString: ").append(bmpString);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class AccessDescription implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerObjectIdentifier accessMethod = null;
|
||||
private GeneralName accessLocation = null;
|
||||
|
||||
public AccessDescription() {
|
||||
}
|
||||
|
||||
public AccessDescription(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setAccessMethod(BerObjectIdentifier accessMethod) {
|
||||
this.accessMethod = accessMethod;
|
||||
}
|
||||
|
||||
public BerObjectIdentifier getAccessMethod() {
|
||||
return accessMethod;
|
||||
}
|
||||
|
||||
public void setAccessLocation(GeneralName accessLocation) {
|
||||
this.accessLocation = accessLocation;
|
||||
}
|
||||
|
||||
public GeneralName getAccessLocation() {
|
||||
return accessLocation;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
codeLength += accessLocation.encode(reverseOS);
|
||||
|
||||
codeLength += accessMethod.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
int numDecodedBytes;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerObjectIdentifier.tag)) {
|
||||
accessMethod = new BerObjectIdentifier();
|
||||
vByteCount += accessMethod.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
accessLocation = new GeneralName();
|
||||
numDecodedBytes = accessLocation.decode(is, berTag);
|
||||
if (numDecodedBytes != 0) {
|
||||
vByteCount += numDecodedBytes;
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (accessMethod != null) {
|
||||
sb.append("accessMethod: ").append(accessMethod);
|
||||
}
|
||||
else {
|
||||
sb.append("accessMethod: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (accessLocation != null) {
|
||||
sb.append("accessLocation: ");
|
||||
accessLocation.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("accessLocation: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,196 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class AnotherName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerObjectIdentifier typeId = null;
|
||||
private BerAny value = null;
|
||||
|
||||
public AnotherName() {
|
||||
}
|
||||
|
||||
public AnotherName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setTypeId(BerObjectIdentifier typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public BerObjectIdentifier getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setValue(BerAny value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public BerAny getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
sublength = value.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
|
||||
codeLength += typeId.encode(reverseOS, true);
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerObjectIdentifier.tag)) {
|
||||
typeId = new BerObjectIdentifier();
|
||||
vByteCount += typeId.decode(is, false);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
vByteCount += length.decode(is);
|
||||
value = new BerAny();
|
||||
vByteCount += value.decode(is, null);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (typeId != null) {
|
||||
sb.append("typeId: ").append(typeId);
|
||||
}
|
||||
else {
|
||||
sb.append("typeId: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (value != null) {
|
||||
sb.append("value: ").append(value);
|
||||
}
|
||||
else {
|
||||
sb.append("value: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class AuthorityInfoAccessSyntax implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<AccessDescription> seqOf = null;
|
||||
|
||||
public AuthorityInfoAccessSyntax() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public AuthorityInfoAccessSyntax(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<AccessDescription> getAccessDescription() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(AccessDescription.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
AccessDescription element = new AccessDescription();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<AccessDescription> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class AuthorityKeyIdentifier implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private KeyIdentifier keyIdentifier = null;
|
||||
private GeneralNames authorityCertIssuer = null;
|
||||
private CertificateSerialNumber authorityCertSerialNumber = null;
|
||||
|
||||
public AuthorityKeyIdentifier() {
|
||||
}
|
||||
|
||||
public AuthorityKeyIdentifier(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setKeyIdentifier(KeyIdentifier keyIdentifier) {
|
||||
this.keyIdentifier = keyIdentifier;
|
||||
}
|
||||
|
||||
public KeyIdentifier getKeyIdentifier() {
|
||||
return keyIdentifier;
|
||||
}
|
||||
|
||||
public void setAuthorityCertIssuer(GeneralNames authorityCertIssuer) {
|
||||
this.authorityCertIssuer = authorityCertIssuer;
|
||||
}
|
||||
|
||||
public GeneralNames getAuthorityCertIssuer() {
|
||||
return authorityCertIssuer;
|
||||
}
|
||||
|
||||
public void setAuthorityCertSerialNumber(CertificateSerialNumber authorityCertSerialNumber) {
|
||||
this.authorityCertSerialNumber = authorityCertSerialNumber;
|
||||
}
|
||||
|
||||
public CertificateSerialNumber getAuthorityCertSerialNumber() {
|
||||
return authorityCertSerialNumber;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (authorityCertSerialNumber != null) {
|
||||
codeLength += authorityCertSerialNumber.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 2
|
||||
reverseOS.write(0x82);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (authorityCertIssuer != null) {
|
||||
codeLength += authorityCertIssuer.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (keyIdentifier != null) {
|
||||
codeLength += keyIdentifier.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 0
|
||||
reverseOS.write(0x80);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
if (lengthVal == 0) {
|
||||
return tlByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
|
||||
keyIdentifier = new KeyIdentifier();
|
||||
vByteCount += keyIdentifier.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
authorityCertIssuer = new GeneralNames();
|
||||
vByteCount += authorityCertIssuer.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
|
||||
authorityCertSerialNumber = new CertificateSerialNumber();
|
||||
vByteCount += authorityCertSerialNumber.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (keyIdentifier != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("keyIdentifier: ").append(keyIdentifier);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (authorityCertIssuer != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("authorityCertIssuer: ");
|
||||
authorityCertIssuer.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (authorityCertSerialNumber != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("authorityCertSerialNumber: ").append(authorityCertSerialNumber);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class BaseCRLNumber extends CRLNumber {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public BaseCRLNumber() {
|
||||
}
|
||||
|
||||
public BaseCRLNumber(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public BaseCRLNumber(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public BaseCRLNumber(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class BaseDistance extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public BaseDistance() {
|
||||
}
|
||||
|
||||
public BaseDistance(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public BaseDistance(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public BaseDistance(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,189 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class BasicConstraints implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private BerBoolean cA = null;
|
||||
private BerInteger pathLenConstraint = null;
|
||||
|
||||
public BasicConstraints() {
|
||||
}
|
||||
|
||||
public BasicConstraints(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setCA(BerBoolean cA) {
|
||||
this.cA = cA;
|
||||
}
|
||||
|
||||
public BerBoolean getCA() {
|
||||
return cA;
|
||||
}
|
||||
|
||||
public void setPathLenConstraint(BerInteger pathLenConstraint) {
|
||||
this.pathLenConstraint = pathLenConstraint;
|
||||
}
|
||||
|
||||
public BerInteger getPathLenConstraint() {
|
||||
return pathLenConstraint;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (pathLenConstraint != null) {
|
||||
codeLength += pathLenConstraint.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
if (cA != null) {
|
||||
codeLength += cA.encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
if (lengthVal == 0) {
|
||||
return tlByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerBoolean.tag)) {
|
||||
cA = new BerBoolean();
|
||||
vByteCount += cA.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerInteger.tag)) {
|
||||
pathLenConstraint = new BerInteger();
|
||||
vByteCount += pathLenConstraint.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (cA != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("cA: ").append(cA);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (pathLenConstraint != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("pathLenConstraint: ").append(pathLenConstraint);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class CPSuri extends BerIA5String {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CPSuri() {
|
||||
}
|
||||
|
||||
public CPSuri(byte[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,161 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class CRLDistributionPoints implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<DistributionPoint> seqOf = null;
|
||||
|
||||
public CRLDistributionPoints() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public CRLDistributionPoints(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<DistributionPoint> getDistributionPoint() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(DistributionPoint.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
DistributionPoint element = new DistributionPoint();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<DistributionPoint> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class CRLNumber extends BerInteger {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CRLNumber() {
|
||||
}
|
||||
|
||||
public CRLNumber(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public CRLNumber(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public CRLNumber(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class CRLReason extends BerEnum {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CRLReason() {
|
||||
}
|
||||
|
||||
public CRLReason(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public CRLReason(BigInteger value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
public CRLReason(long value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class CertPolicyId extends BerObjectIdentifier {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CertPolicyId() {
|
||||
}
|
||||
|
||||
public CertPolicyId(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
public CertPolicyId(int[] value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class CertificateIssuer extends GeneralNames {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CertificateIssuer() {
|
||||
}
|
||||
|
||||
public CertificateIssuer(byte[] code) {
|
||||
super(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,161 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class CertificatePolicies implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<PolicyInformation> seqOf = null;
|
||||
|
||||
public CertificatePolicies() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public CertificatePolicies(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<PolicyInformation> getPolicyInformation() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(PolicyInformation.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
PolicyInformation element = new PolicyInformation();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<PolicyInformation> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
it.next().appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class DisplayText implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private BerIA5String ia5String = null;
|
||||
private BerVisibleString visibleString = null;
|
||||
private BerBMPString bmpString = null;
|
||||
private BerUTF8String utf8String = null;
|
||||
|
||||
public DisplayText() {
|
||||
}
|
||||
|
||||
public DisplayText(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setIa5String(BerIA5String ia5String) {
|
||||
this.ia5String = ia5String;
|
||||
}
|
||||
|
||||
public BerIA5String getIa5String() {
|
||||
return ia5String;
|
||||
}
|
||||
|
||||
public void setVisibleString(BerVisibleString visibleString) {
|
||||
this.visibleString = visibleString;
|
||||
}
|
||||
|
||||
public BerVisibleString getVisibleString() {
|
||||
return visibleString;
|
||||
}
|
||||
|
||||
public void setBmpString(BerBMPString bmpString) {
|
||||
this.bmpString = bmpString;
|
||||
}
|
||||
|
||||
public BerBMPString getBmpString() {
|
||||
return bmpString;
|
||||
}
|
||||
|
||||
public void setUtf8String(BerUTF8String utf8String) {
|
||||
this.utf8String = utf8String;
|
||||
}
|
||||
|
||||
public BerUTF8String getUtf8String() {
|
||||
return utf8String;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (utf8String != null) {
|
||||
codeLength += utf8String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
codeLength += bmpString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (visibleString != null) {
|
||||
codeLength += visibleString.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (ia5String != null) {
|
||||
codeLength += ia5String.encode(reverseOS, true);
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerIA5String.tag)) {
|
||||
ia5String = new BerIA5String();
|
||||
tlvByteCount += ia5String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerVisibleString.tag)) {
|
||||
visibleString = new BerVisibleString();
|
||||
tlvByteCount += visibleString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerBMPString.tag)) {
|
||||
bmpString = new BerBMPString();
|
||||
tlvByteCount += bmpString.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerUTF8String.tag)) {
|
||||
utf8String = new BerUTF8String();
|
||||
tlvByteCount += utf8String.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (ia5String != null) {
|
||||
sb.append("ia5String: ").append(ia5String);
|
||||
return;
|
||||
}
|
||||
|
||||
if (visibleString != null) {
|
||||
sb.append("visibleString: ").append(visibleString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bmpString != null) {
|
||||
sb.append("bmpString: ").append(bmpString);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utf8String != null) {
|
||||
sb.append("utf8String: ").append(utf8String);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,239 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class DistributionPoint implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private DistributionPointName distributionPoint = null;
|
||||
private ReasonFlags reasons = null;
|
||||
private GeneralNames cRLIssuer = null;
|
||||
|
||||
public DistributionPoint() {
|
||||
}
|
||||
|
||||
public DistributionPoint(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setDistributionPoint(DistributionPointName distributionPoint) {
|
||||
this.distributionPoint = distributionPoint;
|
||||
}
|
||||
|
||||
public DistributionPointName getDistributionPoint() {
|
||||
return distributionPoint;
|
||||
}
|
||||
|
||||
public void setReasons(ReasonFlags reasons) {
|
||||
this.reasons = reasons;
|
||||
}
|
||||
|
||||
public ReasonFlags getReasons() {
|
||||
return reasons;
|
||||
}
|
||||
|
||||
public void setCRLIssuer(GeneralNames cRLIssuer) {
|
||||
this.cRLIssuer = cRLIssuer;
|
||||
}
|
||||
|
||||
public GeneralNames getCRLIssuer() {
|
||||
return cRLIssuer;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
if (cRLIssuer != null) {
|
||||
codeLength += cRLIssuer.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
|
||||
reverseOS.write(0xA2);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (reasons != null) {
|
||||
codeLength += reasons.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, PRIMITIVE, 1
|
||||
reverseOS.write(0x81);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
if (distributionPoint != null) {
|
||||
sublength = distributionPoint.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
if (lengthVal == 0) {
|
||||
return tlByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
vByteCount += length.decode(is);
|
||||
distributionPoint = new DistributionPointName();
|
||||
vByteCount += distributionPoint.decode(is, null);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
|
||||
reasons = new ReasonFlags();
|
||||
vByteCount += reasons.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 2)) {
|
||||
cRLIssuer = new GeneralNames();
|
||||
vByteCount += cRLIssuer.decode(is, false);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (distributionPoint != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("distributionPoint: ");
|
||||
distributionPoint.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (reasons != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("reasons: ").append(reasons);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (cRLIssuer != null) {
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("cRLIssuer: ");
|
||||
cRLIssuer.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class DistributionPointName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private byte[] code = null;
|
||||
private GeneralNames fullName = null;
|
||||
private RelativeDistinguishedName nameRelativeToCRLIssuer = null;
|
||||
|
||||
public DistributionPointName() {
|
||||
}
|
||||
|
||||
public DistributionPointName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setFullName(GeneralNames fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
public GeneralNames getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public void setNameRelativeToCRLIssuer(RelativeDistinguishedName nameRelativeToCRLIssuer) {
|
||||
this.nameRelativeToCRLIssuer = nameRelativeToCRLIssuer;
|
||||
}
|
||||
|
||||
public RelativeDistinguishedName getNameRelativeToCRLIssuer() {
|
||||
return nameRelativeToCRLIssuer;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
if (nameRelativeToCRLIssuer != null) {
|
||||
codeLength += nameRelativeToCRLIssuer.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
if (fullName != null) {
|
||||
codeLength += fullName.encode(reverseOS, false);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, null);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, BerTag berTag) throws IOException {
|
||||
|
||||
int tlvByteCount = 0;
|
||||
boolean tagWasPassed = (berTag != null);
|
||||
|
||||
if (berTag == null) {
|
||||
berTag = new BerTag();
|
||||
tlvByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
fullName = new GeneralNames();
|
||||
tlvByteCount += fullName.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
nameRelativeToCRLIssuer = new RelativeDistinguishedName();
|
||||
tlvByteCount += nameRelativeToCRLIssuer.decode(is, false);
|
||||
return tlvByteCount;
|
||||
}
|
||||
|
||||
if (tagWasPassed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
if (fullName != null) {
|
||||
sb.append("fullName: ");
|
||||
fullName.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nameRelativeToCRLIssuer != null) {
|
||||
sb.append("nameRelativeToCRLIssuer: ");
|
||||
nameRelativeToCRLIssuer.appendAsString(sb, indentLevel + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
sb.append("<none>");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class EDIPartyName implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
|
||||
private byte[] code = null;
|
||||
private DirectoryString nameAssigner = null;
|
||||
private DirectoryString partyName = null;
|
||||
|
||||
public EDIPartyName() {
|
||||
}
|
||||
|
||||
public EDIPartyName(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setNameAssigner(DirectoryString nameAssigner) {
|
||||
this.nameAssigner = nameAssigner;
|
||||
}
|
||||
|
||||
public DirectoryString getNameAssigner() {
|
||||
return nameAssigner;
|
||||
}
|
||||
|
||||
public void setPartyName(DirectoryString partyName) {
|
||||
this.partyName = partyName;
|
||||
}
|
||||
|
||||
public DirectoryString getPartyName() {
|
||||
return partyName;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
int sublength;
|
||||
|
||||
sublength = partyName.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
|
||||
reverseOS.write(0xA1);
|
||||
codeLength += 1;
|
||||
|
||||
if (nameAssigner != null) {
|
||||
sublength = nameAssigner.encode(reverseOS);
|
||||
codeLength += sublength;
|
||||
codeLength += BerLength.encodeLength(reverseOS, sublength);
|
||||
// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
|
||||
reverseOS.write(0xA0);
|
||||
codeLength += 1;
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
|
||||
vByteCount += length.decode(is);
|
||||
nameAssigner = new DirectoryString();
|
||||
vByteCount += nameAssigner.decode(is, null);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
|
||||
if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
|
||||
vByteCount += length.decode(is);
|
||||
partyName = new DirectoryString();
|
||||
vByteCount += partyName.decode(is, null);
|
||||
vByteCount += length.readEocIfIndefinite(is);
|
||||
if (lengthVal >= 0 && vByteCount == lengthVal) {
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
vByteCount += berTag.decode(is);
|
||||
}
|
||||
else {
|
||||
throw new IOException("Tag does not match mandatory sequence component.");
|
||||
}
|
||||
|
||||
if (lengthVal < 0) {
|
||||
if (!berTag.equals(0, 0, 0)) {
|
||||
throw new IOException("Decoded sequence has wrong end of contents octets");
|
||||
}
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
throw new IOException("Unexpected end of sequence, length tag: " + lengthVal + ", bytes decoded: " + vByteCount);
|
||||
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{");
|
||||
boolean firstSelectedElement = true;
|
||||
if (nameAssigner != null) {
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("nameAssigner: ");
|
||||
nameAssigner.appendAsString(sb, indentLevel + 1);
|
||||
firstSelectedElement = false;
|
||||
}
|
||||
|
||||
if (!firstSelectedElement) {
|
||||
sb.append(",\n");
|
||||
}
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (partyName != null) {
|
||||
sb.append("partyName: ");
|
||||
partyName.appendAsString(sb, indentLevel + 1);
|
||||
}
|
||||
else {
|
||||
sb.append("partyName: <empty-required-field>");
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
/*
|
||||
* This class file was automatically generated by ASN1bean v1.13.0 (http://www.beanit.com)
|
||||
*/
|
||||
|
||||
package com.truphone.rsp.dto.asn1.pkix1implicit88;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.EOFException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.io.Serializable;
|
||||
import com.beanit.asn1bean.ber.*;
|
||||
import com.beanit.asn1bean.ber.types.*;
|
||||
import com.beanit.asn1bean.ber.types.string.*;
|
||||
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Attribute;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.CertificateSerialNumber;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.DirectoryString;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.Name;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.ORAddress;
|
||||
import com.truphone.rsp.dto.asn1.pkix1explicit88.RelativeDistinguishedName;
|
||||
|
||||
public class ExtKeyUsageSyntax implements BerType, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
|
||||
private byte[] code = null;
|
||||
private List<KeyPurposeId> seqOf = null;
|
||||
|
||||
public ExtKeyUsageSyntax() {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
|
||||
public ExtKeyUsageSyntax(byte[] code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<KeyPurposeId> getKeyPurposeId() {
|
||||
if (seqOf == null) {
|
||||
seqOf = new ArrayList<>();
|
||||
}
|
||||
return seqOf;
|
||||
}
|
||||
|
||||
@Override public int encode(OutputStream reverseOS) throws IOException {
|
||||
return encode(reverseOS, true);
|
||||
}
|
||||
|
||||
public int encode(OutputStream reverseOS, boolean withTag) throws IOException {
|
||||
|
||||
if (code != null) {
|
||||
reverseOS.write(code);
|
||||
if (withTag) {
|
||||
return tag.encode(reverseOS) + code.length;
|
||||
}
|
||||
return code.length;
|
||||
}
|
||||
|
||||
int codeLength = 0;
|
||||
for (int i = (seqOf.size() - 1); i >= 0; i--) {
|
||||
codeLength += seqOf.get(i).encode(reverseOS, true);
|
||||
}
|
||||
|
||||
codeLength += BerLength.encodeLength(reverseOS, codeLength);
|
||||
|
||||
if (withTag) {
|
||||
codeLength += tag.encode(reverseOS);
|
||||
}
|
||||
|
||||
return codeLength;
|
||||
}
|
||||
|
||||
@Override public int decode(InputStream is) throws IOException {
|
||||
return decode(is, true);
|
||||
}
|
||||
|
||||
public int decode(InputStream is, boolean withTag) throws IOException {
|
||||
int tlByteCount = 0;
|
||||
int vByteCount = 0;
|
||||
BerTag berTag = new BerTag();
|
||||
if (withTag) {
|
||||
tlByteCount += tag.decodeAndCheck(is);
|
||||
}
|
||||
|
||||
BerLength length = new BerLength();
|
||||
tlByteCount += length.decode(is);
|
||||
int lengthVal = length.val;
|
||||
|
||||
while (vByteCount < lengthVal || lengthVal < 0) {
|
||||
vByteCount += berTag.decode(is);
|
||||
|
||||
if (lengthVal < 0 && berTag.equals(0, 0, 0)) {
|
||||
vByteCount += BerLength.readEocByte(is);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!berTag.equals(KeyPurposeId.tag)) {
|
||||
throw new IOException("Tag does not match mandatory sequence of/set of component.");
|
||||
}
|
||||
KeyPurposeId element = new KeyPurposeId();
|
||||
vByteCount += element.decode(is, false);
|
||||
seqOf.add(element);
|
||||
}
|
||||
if (lengthVal >= 0 && vByteCount != lengthVal) {
|
||||
throw new IOException("Decoded SequenceOf or SetOf has wrong length. Expected " + lengthVal + " but has " + vByteCount);
|
||||
|
||||
}
|
||||
return tlByteCount + vByteCount;
|
||||
}
|
||||
|
||||
public void encodeAndSave(int encodingSizeGuess) throws IOException {
|
||||
ReverseByteArrayOutputStream reverseOS = new ReverseByteArrayOutputStream(encodingSizeGuess);
|
||||
encode(reverseOS, false);
|
||||
code = reverseOS.getArray();
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendAsString(sb, 0);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void appendAsString(StringBuilder sb, int indentLevel) {
|
||||
|
||||
sb.append("{\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
if (seqOf == null) {
|
||||
sb.append("null");
|
||||
}
|
||||
else {
|
||||
Iterator<KeyPurposeId> it = seqOf.iterator();
|
||||
if (it.hasNext()) {
|
||||
sb.append(it.next());
|
||||
while (it.hasNext()) {
|
||||
sb.append(",\n");
|
||||
for (int i = 0; i < indentLevel + 1; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < indentLevel; i++) {
|
||||
sb.append("\t");
|
||||
}
|
||||
sb.append("}");
|
||||
}
|
||||
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue