public class PlainDSAEncoding extends java.lang.Object implements DSAEncoding
Modifier and Type | Field and Description |
---|---|
static PlainDSAEncoding |
INSTANCE |
Constructor and Description |
---|
PlainDSAEncoding() |
Modifier and Type | Method and Description |
---|---|
protected java.math.BigInteger |
checkValue(java.math.BigInteger n,
java.math.BigInteger x) |
java.math.BigInteger[] |
decode(java.math.BigInteger n,
byte[] encoding)
Decode the (r, s) pair of a DSA signature.
|
protected java.math.BigInteger |
decodeValue(java.math.BigInteger n,
byte[] buf,
int off,
int len) |
byte[] |
encode(java.math.BigInteger n,
java.math.BigInteger r,
java.math.BigInteger s)
Encode the (r, s) pair of a DSA signature.
|
public static final PlainDSAEncoding INSTANCE
public byte[] encode(java.math.BigInteger n, java.math.BigInteger r, java.math.BigInteger s)
DSAEncoding
encode
in interface DSAEncoding
n
- the order of the group that r, s belong to.r
- the r value of a DSA signature.s
- the s value of a DSA signature.public java.math.BigInteger[] decode(java.math.BigInteger n, byte[] encoding)
DSAEncoding
decode
in interface DSAEncoding
n
- the order of the group that r, s belong to.encoding
- an encoding of the (r, s) pair of a DSA signature.protected java.math.BigInteger checkValue(java.math.BigInteger n, java.math.BigInteger x)
protected java.math.BigInteger decodeValue(java.math.BigInteger n, byte[] buf, int off, int len)