Package org.bouncycastle.crypto.signers
Class StandardDSAEncoding
- java.lang.Object
-
- org.bouncycastle.crypto.signers.StandardDSAEncoding
-
- All Implemented Interfaces:
DSAEncoding
public class StandardDSAEncoding extends Object implements DSAEncoding
-
-
Field Summary
Fields Modifier and Type Field Description static StandardDSAEncoding
INSTANCE
-
Constructor Summary
Constructors Constructor Description StandardDSAEncoding()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BigInteger
checkValue(BigInteger n, BigInteger x)
BigInteger[]
decode(BigInteger n, byte[] encoding)
Decode the (r, s) pair of a DSA signature.protected BigInteger
decodeValue(BigInteger n, ASN1Sequence s, int pos)
byte[]
encode(BigInteger n, BigInteger r, BigInteger s)
Encode the (r, s) pair of a DSA signature.protected void
encodeValue(BigInteger n, ASN1EncodableVector v, BigInteger x)
-
-
-
Field Detail
-
INSTANCE
public static final StandardDSAEncoding INSTANCE
-
-
Method Detail
-
encode
public byte[] encode(BigInteger n, BigInteger r, BigInteger s) throws IOException
Description copied from interface:DSAEncoding
Encode the (r, s) pair of a DSA signature.- Specified by:
encode
in interfaceDSAEncoding
- Parameters:
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.- Returns:
- an encoding of the DSA signature given by the provided (r, s) pair.
- Throws:
IOException
-
decode
public BigInteger[] decode(BigInteger n, byte[] encoding) throws IOException
Description copied from interface:DSAEncoding
Decode the (r, s) pair of a DSA signature.- Specified by:
decode
in interfaceDSAEncoding
- Parameters:
n
- the order of the group that r, s belong to.encoding
- an encoding of the (r, s) pair of a DSA signature.- Returns:
- the (r, s) of a DSA signature, stored in an array of exactly two elements, r followed by s.
- Throws:
IOException
-
checkValue
protected BigInteger checkValue(BigInteger n, BigInteger x)
-
decodeValue
protected BigInteger decodeValue(BigInteger n, ASN1Sequence s, int pos)
-
encodeValue
protected void encodeValue(BigInteger n, ASN1EncodableVector v, BigInteger x)
-
-