def verify(self, signature): """ Verifies **signature**, using the public key data in the object. The signature's length must be equal to: **self.output_size** Returns a string containing the plaintext. """ signature = t2b(signature) plaintext = t2b("\0" * self.output_size) ret = _lib.wc_RsaSSL_Verify(signature, len(signature), plaintext, len(plaintext), self.native_object) if ret < 0: raise WolfCryptError("Verify error (%d)" % ret) return plaintext[:ret]
def verify(self, signature): """ Verifies **signature**, using the public key data in the object. The signature's length must be equal to: **self.output_size** Returns a string containing the plaintext. """ signature = t2b(signature) plaintext = _ffi.new("byte[%d]" % self.output_size) ret = _lib.wc_RsaSSL_Verify(signature, len(signature), plaintext, self.output_size, self.native_object) if ret < 0: # pragma: no cover raise WolfCryptError("Verify error (%d)" % ret) return _ffi.buffer(plaintext, ret)[:]