autobahn.xbr._eip712_authority_certificate
Module Contents¶
Classes¶
Functions¶
Authority certificate: long-lived, on-chain L2. |
|
|
Sign the given data using a EIP712 based signature with the provided private key. |
|
Recover the signer address the given EIP712 signature was signed with. |
- autobahn.xbr._eip712_authority_certificate.create_eip712_authority_certificate(chainId: int, verifyingContract: bytes, validFrom: int, issuer: bytes, subject: bytes, realm: bytes, capabilities: int, meta: str) dict [source]¶
Authority certificate: long-lived, on-chain L2.
- Parameters
chainId –
verifyingContract –
validFrom –
issuer –
subject –
realm –
capabilities –
meta –
- Returns
- autobahn.xbr._eip712_authority_certificate.sign_eip712_authority_certificate(eth_privkey: bytes, chainId: int, verifyingContract: bytes, validFrom: int, issuer: bytes, subject: bytes, realm: bytes, capabilities: int, meta: str) bytes [source]¶
Sign the given data using a EIP712 based signature with the provided private key.
- Parameters
eth_privkey –
chainId –
verifyingContract –
validFrom –
issuer –
subject –
realm –
capabilities –
meta –
- Returns
- autobahn.xbr._eip712_authority_certificate.recover_eip712_authority_certificate(chainId: int, verifyingContract: bytes, validFrom: int, issuer: bytes, subject: bytes, realm: bytes, capabilities: int, meta: str, signature: bytes) bytes [source]¶
Recover the signer address the given EIP712 signature was signed with.
- Parameters
chainId –
verifyingContract –
validFrom –
issuer –
subject –
realm –
capabilities –
meta –
signature –
- Returns
The (computed) signer address the signature was signed with.
- class autobahn.xbr._eip712_authority_certificate.EIP712AuthorityCertificate(chainId: int, verifyingContract: bytes, validFrom: int, issuer: bytes, subject: bytes, realm: bytes, capabilities: int, meta: str, signatures: Optional[List[bytes]] = None)[source]¶
Bases:
autobahn.xbr._eip712_certificate.EIP712Certificate
- CAPABILITY_ROOT_CA = 1¶
- CAPABILITY_INTERMEDIATE_CA = 2¶
- CAPABILITY_PUBLIC_RELAY = 4¶
- CAPABILITY_PRIVATE_RELAY = 8¶
- CAPABILITY_PROVIDER = 16¶
- CAPABILITY_CONSUMER = 32¶
- __slots__ = ['chainId', 'verifyingContract', 'validFrom', 'issuer', 'subject', 'realm', 'capabilities',...¶
- sign(key: autobahn.xbr._secmod.EthereumKey, binary: bool = False) bytes [source]¶
- static parse(obj, binary: bool = False) EIP712AuthorityCertificate [source]¶
- save(filename: str) int [source]¶
Save certificate to file. File format (serialized as CBOR):
[cert_hash: bytes, cert_eip712: Dict[str, Any], cert_signatures: List[bytes]]
- Parameters
filename –
- Returns
- static load(filename) EIP712AuthorityCertificate [source]¶
Load certificate from file.
- Parameters
filename –
- Returns