Class PlainDSAEncoding

    • Constructor Detail

      • PlainDSAEncoding

        public PlainDSAEncoding()
    • Method Detail

      • encode

        public byte[] encode​(BigInteger n,
                             BigInteger r,
                             BigInteger s)
        Description copied from interface: DSAEncoding
        Encode the (r, s) pair of a DSA signature.
        Specified by:
        encode in interface DSAEncoding
        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.
      • decode

        public BigInteger[] decode​(BigInteger n,
                                   byte[] encoding)
        Description copied from interface: DSAEncoding
        Decode the (r, s) pair of a DSA signature.
        Specified by:
        decode in interface DSAEncoding
        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.