def sign(self, plaintext): """ Signs **plaintext**, using the private key data in the object. The plaintext's length must not be greater than: **self.output_size - self.RSA_MIN_PAD_SIZE** Returns a string containing the signature. """ plaintext = t2b(plaintext) signature = t2b("\0" * self.output_size) ret = _lib.wc_RsaSSL_Sign(plaintext, len(plaintext), signature, len(signature), self.native_object, self._random.native_object) if ret != self.output_size: raise WolfCryptError("Signature error (%d)" % ret) return signature
def sign(self, plaintext): """ Signs **plaintext**, using the private key data in the object. The plaintext's length must not be greater than: **self.output_size - self.RSA_MIN_PAD_SIZE** Returns a string containing the signature. """ plaintext = t2b(plaintext) signature = t2b("\0" * self.output_size) ret = _lib.wc_RsaSSL_Sign( plaintext, len(plaintext), signature, len(signature), self.native_object, self._random.native_object ) if ret != self.output_size: raise WolfCryptError("Signature error (%d)" % ret) return signature