model/utils.py
def sign(private_key: RsaKey, content: dict) -> None:
    """Returns a signature according to a private key and a content"""

    signer = PKCS1_v1_5.new(private_key)
    encoded_content = json.dumps(content, sort_keys=True).encode()
    h = SHA256.new(encoded_content)
    signature = signer.sign(h)

    return binascii.hexlify(signature).decode('ascii')
Returns a signature according to a private key and a content
Returns a signature according to a private key and a content
Returns a signature according to a private key and a content
def sign(private_key: RsaKey, content: dict) -> None:
    signer = PKCS1_v1_5.new(private_key)
    encoded_content = json.dumps(content, sort_keys=True).encode()
    h = SHA256.new(encoded_content)
    signature = signer.sign(h)
    return binascii.hexlify(signature).decode('ascii')
def sign ( private_key : RsaKey , content : dict ) -> None : signer = PKCS1_v1_5 . new ( private_key ) encoded_content = json . dumps ( content , sort_keys = True ) . encode ( ) h = SHA256 . new ( encoded_content ) signature = signer . sign ( h ) return binascii . hexlify ( signature ) . decode ( 'ascii' )
Returns a signature according to a private key and a content
Returns a signature according to a private key and a content
"""Returns a signature according to a private key and a content"""
private_key
RsaKey
content
dict