Class SignatureEcBc

    • Method Detail

      • getHead

        protected int getHead()
        Returns:
        number of bytes reserved at the beginning (header) of the binary data.
      • deserialize

        protected void deserialize()
        Initializes the internal fields like r and s from binary data.
      • createData

        protected static byte[] createData​(int head,
                                           BigInteger r,
                                           BigInteger s)
        Parameters:
        head - the number of bytes reserved at the beginning.
        r - the value r.
        s - the value s.
        Returns:
        the binary data.
      • recoverPublicKey

        protected org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey recoverPublicKey​(byte[] message,
                                                                                                byte recoveryIndex)
        Parameters:
        message - the payload (typically hash of message) that was signed when this signature was created.
        recoveryIndex - the recovery index for public key recovery.
        Returns:
        the recovered public key.
      • calculateRecoveryIndex

        protected static byte calculateRecoveryIndex​(byte[] message,
                                                     CryptoEllipticCurveBc curve,
                                                     BigInteger r,
                                                     BigInteger s,
                                                     org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey publicKey)
        Parameters:
        message - the payload (typically hash of message) that was signed when this signature was created.
        curve - the elliptic curve.
        r - value R.
        s - value S.
        publicKey - the public key corresponding to the private key that was used to sign the message.
        Returns:
        the recovery index.
      • recoverPublicKey

        protected static org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey recoverPublicKey​(byte[] message,
                                                                                                       CryptoEllipticCurveBc curve,
                                                                                                       BigInteger r,
                                                                                                       BigInteger s,
                                                                                                       byte recoveryIndex)
        Parameters:
        message - the payload (typically hash of message) that was signed when this signature was created.
        curve - the elliptic curve.
        r - value R.
        s - value S.
        recoveryIndex - the recovery index for public key recovery.
        Returns:
        the recovered public key.