public String toString() { StringBuffer sb = new StringBuffer(); sb.append("["); if (isConstructed()) { sb.append("CONSTRUCTED "); } sb.append("APPLICATION "); sb.append(Integer.toString(getApplicationTag())); sb.append("]"); // @todo content encoding somehow? if (this.octets != null) { sb.append(" #"); sb.append(Hex.toHexString(this.octets)); } else { sb.append(" #null"); } sb.append(" "); return sb.toString(); } }
public static int encodeTag(ASN1ApplicationSpecific spec) boolean constructed = spec.isConstructed(); if (constructed)
private static String outputApplicationSpecific(String type, String indent, boolean verbose, ASN1Primitive obj, String nl) { ASN1ApplicationSpecific app = ASN1ApplicationSpecific.getInstance(obj); StringBuffer buf = new StringBuffer(); if (app.isConstructed()) { try { ASN1Sequence s = ASN1Sequence.getInstance(app.getObject(BERTags.SEQUENCE)); buf.append(indent + type + " ApplicationSpecific[" + app.getApplicationTag() + "]" + nl); for (Enumeration e = s.getObjects(); e.hasMoreElements();) { _dumpAsString(indent + TAB, verbose, (ASN1Primitive)e.nextElement(), buf); } } catch (IOException e) { buf.append(e); } return buf.toString(); } return indent + type + " ApplicationSpecific[" + app.getApplicationTag() + "] (" + Strings.fromByteArray(Hex.encode(app.getContents())) + ")" + nl; }
private CVCertificateRequest(ASN1ApplicationSpecific request) throws IOException { this.original = request; if (request.isConstructed() && request.getApplicationTag() == EACTags.AUTHENTIFICATION_DATA) { ASN1Sequence seq = ASN1Sequence.getInstance(request.getObject(BERTags.SEQUENCE)); initCertBody(ASN1ApplicationSpecific.getInstance(seq.getObjectAt(0))); outerSignature = ASN1ApplicationSpecific.getInstance(seq.getObjectAt(seq.size() - 1)).getContents(); } else { initCertBody(request); } }