Package org.bouncycastle.gpg
Class SExpression
- java.lang.Object
-
- org.bouncycastle.gpg.SExpression
-
public class SExpression extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SExpression.Builder
static class
SExpression.QuotedString
-
Constructor Summary
Constructors Constructor Description SExpression()
SExpression(java.util.List<java.lang.Object> values)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(java.lang.Object value)
static SExpression.Builder
builder()
SExpression
filterIn(java.lang.String... keys)
SExpression
filterOut(java.lang.String... keys)
byte[]
getBytes(int i)
SExpression
getExpression(int i)
SExpression
getExpressionWithLabel(java.lang.String label)
SExpression
getExpressionWithLabelOrFail(java.lang.String label)
int
getInt(int i)
java.lang.String
getString(int i)
java.lang.Object
getValue(int i)
java.util.List<java.lang.Object>
getValues()
boolean
hasLabel(java.lang.String label)
boolean
isCanonical()
static SExpression
parse(byte[] src, int maxDepth)
static SExpression
parse(java.io.InputStream _src, int maxDepth)
Parser for canonical and normal S-ExpressionsPGPExtendedKeyAttribute
toAttribute()
byte[]
toCanonicalForm()
void
toCanonicalForm(java.io.OutputStream out)
-
-
-
Method Detail
-
parse
public static SExpression parse(byte[] src, int maxDepth) throws java.io.IOException
- Throws:
java.io.IOException
-
parse
public static SExpression parse(java.io.InputStream _src, int maxDepth) throws java.io.IOException
Parser for canonical and normal S-Expressions- Parameters:
_src
- InputmaxDepth
- maximum recursion depth before failing- Returns:
- An SExpression
- Throws:
java.io.IOException
-
builder
public static SExpression.Builder builder()
-
addValue
public void addValue(java.lang.Object value)
-
getValue
public java.lang.Object getValue(int i)
-
getString
public java.lang.String getString(int i)
-
getInt
public int getInt(int i)
-
getBytes
public byte[] getBytes(int i)
-
getExpression
public SExpression getExpression(int i)
-
getValues
public java.util.List<java.lang.Object> getValues()
-
isCanonical
public boolean isCanonical()
-
toAttribute
public PGPExtendedKeyAttribute toAttribute()
-
filterOut
public SExpression filterOut(java.lang.String... keys)
-
filterIn
public SExpression filterIn(java.lang.String... keys)
-
toCanonicalForm
public byte[] toCanonicalForm()
-
toCanonicalForm
public void toCanonicalForm(java.io.OutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
hasLabel
public boolean hasLabel(java.lang.String label)
-
getExpressionWithLabel
public SExpression getExpressionWithLabel(java.lang.String label)
-
getExpressionWithLabelOrFail
public SExpression getExpressionWithLabelOrFail(java.lang.String label)
-
-