fi.hut.tcm.spki.impl
Class SpkiParserVisitor

java.lang.Object
  |
  +--fi.hut.tcm.spki.impl.SpkiParserVisitor

public class SpkiParserVisitor
extends java.lang.Object
implements ComponentVisitor

SpkiParserVisitor Creates and traverses Generic Format based on parsing SPKI Canonical Format.


Field Summary
private  java.io.ByteArrayInputStream bin
           
private static int LOOK_AHEAD
           
 
Constructor Summary
SpkiParserVisitor()
           
 
Method Summary
private  Component alternation(java.lang.String[] choices)
          Tests if CanonicalSpki has one of the choices as the next s-expression.
 void at(java.lang.Object node)
           
 void att(ByteString node)
           
 void att(Cert node)
           
 void att(Comment node)
           
 void att(Deleg node)
           
 void att(GeneralOp node)
           
 void att(Gte node)
           
 void att(Hash node)
           
 void att(HashAlgName node)
           
 void att(HashOfKey node)
           
 void att(HashOp node)
           
 void att(HashValue node)
           
 void att(Issuer node)
           
 void att(Keyholder node)
           
 void att(KVal node)
           
 void att(LowLim node)
           
 void att(Lte node)
           
 void att(Name node)
           
 void att(NotAfter node)
           
 void att(NotBefore node)
           
 void att(ObjHash node)
           
 void att(OnlineTest node)
           
 void att(OnlineType node)
           
 void att(PubKey node)
           
 void att(PubSigAlgId node)
           
 void att(RangeOrdering node)
           
 void att(SecKey node)
           
 void att(SecSigAlgId node)
           
 void att(Sequence node)
           
 void att(SExpr node)
           
 void att(Sig node)
           
 void att(SigVal node)
           
 void att(SPart node)
           
 void att(Subject node)
           
 void att(Tag node)
           
 void att(TagExpr node)
           
 void att(TagPrefix node)
           
 void att(TagRange node)
           
 void att(TagSet node)
           
 void att(TagSimple node)
           
 void att(TagStar node)
           
 void att(TagString node)
           
 void att(ThresholdSubj node)
           
 void att(Time node)
           
 void att(UpLim node)
           
 void att(Uri node)
           
 void att(Valid node)
           
private  Component getInstance(java.lang.String type)
          Gets an instance of a class that matches the given string indentifier.
private  void moveToEndOfSExpr()
           
private  java.lang.String readString()
          Returns following string.
private  java.lang.String readType()
          Reads the type of the following s-expression.
private  Component recurse(Component into)
           
 GenericFormat run(CanonicalSpki convertThis)
           
private  void skipClosingParentheses()
           
private  void skipOpeningParentheses()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

LOOK_AHEAD

private static final int LOOK_AHEAD

bin

private java.io.ByteArrayInputStream bin
Constructor Detail

SpkiParserVisitor

public SpkiParserVisitor()
Method Detail

run

public GenericFormat run(CanonicalSpki convertThis)
                  throws java.lang.IllegalArgumentException

att

public void att(Sequence node)
Specified by:
att in interface ComponentVisitor

att

public void att(SPart node)
Specified by:
att in interface ComponentVisitor

att

public void att(Hash node)
Specified by:
att in interface ComponentVisitor

att

public void att(SExpr node)
Specified by:
att in interface ComponentVisitor

att

public void att(HashAlgName node)
Specified by:
att in interface ComponentVisitor

att

public void att(Issuer node)
Specified by:
att in interface ComponentVisitor

att

public void att(Subject node)
Specified by:
att in interface ComponentVisitor

att

public void att(GeneralOp node)
Specified by:
att in interface ComponentVisitor

att

public void att(HashOp node)
Specified by:
att in interface ComponentVisitor

att

public void att(Name node)
Specified by:
att in interface ComponentVisitor

att

public void att(Keyholder node)
Specified by:
att in interface ComponentVisitor

att

public void att(ThresholdSubj node)
Specified by:
att in interface ComponentVisitor

att

public void att(SecKey node)
Specified by:
att in interface ComponentVisitor

att

public void att(PubKey node)
Specified by:
att in interface ComponentVisitor

att

public void att(PubSigAlgId node)
Specified by:
att in interface ComponentVisitor

att

public void att(SecSigAlgId node)
Specified by:
att in interface ComponentVisitor

att

public void att(OnlineTest node)
Specified by:
att in interface ComponentVisitor

att

public void att(ObjHash node)
Specified by:
att in interface ComponentVisitor

att

public void att(Tag node)
Specified by:
att in interface ComponentVisitor

att

public void att(Sig node)
Specified by:
att in interface ComponentVisitor

att

public void att(Cert node)
Specified by:
att in interface ComponentVisitor

att

public void att(Valid node)
Specified by:
att in interface ComponentVisitor

att

public void att(NotBefore node)
Specified by:
att in interface ComponentVisitor

att

public void att(NotAfter node)
Specified by:
att in interface ComponentVisitor

att

public void att(Deleg node)
Specified by:
att in interface ComponentVisitor

att

public void att(Comment node)
Specified by:
att in interface ComponentVisitor

att

public void att(KVal node)
Specified by:
att in interface ComponentVisitor

att

public void att(Uri node)
Specified by:
att in interface ComponentVisitor

att

public void att(OnlineType node)
         throws java.lang.IllegalArgumentException
Specified by:
att in interface ComponentVisitor

att

public void att(HashValue node)
Specified by:
att in interface ComponentVisitor

att

public void att(Time node)
Specified by:
att in interface ComponentVisitor

att

public void att(HashOfKey node)
Specified by:
att in interface ComponentVisitor

att

public void att(SigVal node)
Specified by:
att in interface ComponentVisitor

att

public void att(ByteString node)
         throws java.lang.IllegalArgumentException
Specified by:
att in interface ComponentVisitor

att

public void att(Lte node)
         throws java.lang.IllegalArgumentException
Specified by:
att in interface ComponentVisitor

att

public void att(Gte node)
         throws java.lang.IllegalArgumentException
Specified by:
att in interface ComponentVisitor

att

public void att(RangeOrdering node)
         throws java.lang.IllegalArgumentException
Specified by:
att in interface ComponentVisitor

att

public void att(TagStar node)
Specified by:
att in interface ComponentVisitor

att

public void att(UpLim node)
Specified by:
att in interface ComponentVisitor

att

public void att(LowLim node)
Specified by:
att in interface ComponentVisitor

att

public void att(TagRange node)
Specified by:
att in interface ComponentVisitor

att

public void att(TagPrefix node)
Specified by:
att in interface ComponentVisitor

att

public void att(TagSet node)
Specified by:
att in interface ComponentVisitor

att

public void att(TagString node)
Specified by:
att in interface ComponentVisitor

att

public void att(TagSimple node)
Specified by:
att in interface ComponentVisitor

att

public void att(TagExpr node)
         throws java.lang.IllegalArgumentException
Specified by:
att in interface ComponentVisitor

at

public void at(java.lang.Object node)

alternation

private Component alternation(java.lang.String[] choices)
                       throws java.lang.IllegalArgumentException
Tests if CanonicalSpki has one of the choices as the next s-expression. If it does, returns a component of the corresponding type. Returns null if the list was over and throws IllegalArgumentException if match was not found.

getInstance

private Component getInstance(java.lang.String type)
Gets an instance of a class that matches the given string indentifier. Returns null if match was not found.

readType

private java.lang.String readType()
                           throws java.lang.IllegalArgumentException
Reads the type of the following s-expression. Returns null if the first byte was ')', meaning the list was over. Throws an exception for unexpected bytes in the input.

readString

private java.lang.String readString()
                             throws java.lang.IllegalArgumentException
Returns following string. Throws an exception for unexpected input.

recurse

private Component recurse(Component into)

moveToEndOfSExpr

private void moveToEndOfSExpr()

skipClosingParentheses

private void skipClosingParentheses()
                             throws java.lang.IllegalArgumentException

skipOpeningParentheses

private void skipOpeningParentheses()
                             throws java.lang.IllegalArgumentException