virgil_crypto.access_token_signer module

class virgil_crypto.access_token_signer.AccessTokenSigner(crypto=<virgil_crypto.crypto.VirgilCrypto object>)[source]

Bases: object

Access Token cryptographic signature operations Class provides a cryptographic signature operations for Access Token.

property algorithm

Get Algorithm

property crypto

Get Crypto

generate_token_signature(token, private_key)[source]

Generate signature for Access token

Parameters
  • token – Access Token bytes.

  • private_key – Signer Private Key.

Returns

Signature bytes.

Raises

ValueError – if token or private key missing or malformed

verify_token_signature(signature, token, public_key)[source]

Verify Access Token signature

Parameters
  • signature – Token signature bytes

  • token – Access Token

  • public_key – Signer Public Key

Returns

True if signature is valid, False otherwise.

Raises

ValueError – if public key or token missed or malformed.