Class SExpression

java.lang.Object
org.bouncycastle.gpg.SExpression

public class SExpression extends Object
  • Constructor Details

    • SExpression

      public SExpression(List<Object> values)
    • SExpression

      public SExpression()
  • Method Details

    • parse

      public static SExpression parse(byte[] src, int maxDepth) throws IOException
      Throws:
      IOException
    • parse

      public static SExpression parse(InputStream _src, int maxDepth) throws IOException
      Parser for canonical and normal S-Expressions
      Parameters:
      _src - Input
      maxDepth - maximum recursion depth before failing
      Returns:
      An SExpression
      Throws:
      IOException
    • builder

      public static SExpression.Builder builder()
    • addValue

      public void addValue(Object value)
    • getValue

      public Object getValue(int i)
    • getString

      public String getString(int i)
    • getInt

      public int getInt(int i)
    • getBytes

      public byte[] getBytes(int i)
    • getExpression

      public SExpression getExpression(int i)
    • getValues

      public List<Object> getValues()
    • isCanonical

      public boolean isCanonical()
    • toAttribute

      public PGPExtendedKeyAttribute toAttribute()
    • filterOut

      public SExpression filterOut(String... keys)
    • filterIn

      public SExpression filterIn(String... keys)
    • toCanonicalForm

      public byte[] toCanonicalForm()
    • toCanonicalForm

      public void toCanonicalForm(OutputStream out) throws IOException
      Throws:
      IOException
    • hasLabel

      public boolean hasLabel(String label)
      Return true if this expression's first value is the passed in label.
      Parameters:
      label - the label to look for.
      Returns:
      true if the first value is a string, quoted string or octet string equal to label, false otherwise, including when the expression is empty or starts with a nested expression.
    • getExpressionWithLabel

      public SExpression getExpressionWithLabel(String label)
    • getExpressionWithLabelOrFail

      public SExpression getExpressionWithLabelOrFail(String label)