monero_keys

Module for Monero keys handling.

class MoneroPublicKey(pub_key: IPublicKey)

Bases: object

Monero public key class.

classmethod FromBytesOrKeyObject(pub_key: Union[bytes, IPublicKey]) MoneroPublicKey

Get the public key from key bytes or object.

Parameters:

pub_key (bytes or IPublicKey) – Public key

Returns:

MoneroPublicKey object

Return type:

MoneroPublicKey object

Raises:

MoneroKeyError – If the key constructed from the bytes is not valid

classmethod FromBytes(key_bytes: bytes) MoneroPublicKey

Create from bytes.

Parameters:

key_bytes (bytes) – Key bytes

Returns:

MoneroPublicKey object

Return type:

MoneroPublicKey object

Raises:

MoneroKeyError – If the key constructed from the bytes is not valid

classmethod FromPoint(key_point: IPoint) MoneroPublicKey

Create from point.

Parameters:

key_point (IPoint object) – Key point

Returns:

MoneroPublicKey object

Return type:

MoneroPublicKey object

Raises:

Bip32KeyError – If the key constructed from the bytes is not valid

m_pub_key: IPublicKey
KeyObject() IPublicKey

Return the key object.

Returns:

Key object

Return type:

IPublicKey object

RawCompressed() DataBytes

Return raw compressed public key.

Returns:

DataBytes object

Return type:

DataBytes object

RawUncompressed() DataBytes

Return raw uncompressed public key.

Returns:

DataBytes object

Return type:

DataBytes object

class MoneroPrivateKey(priv_key: IPrivateKey)

Bases: object

Monero private key class.

classmethod FromBytesOrKeyObject(priv_key: Union[bytes, IPrivateKey]) MoneroPrivateKey

Get the private key from key bytes or object.

Parameters:

priv_key (bytes or IPrivateKey) – Private key

Returns:

MoneroPrivateKey object

Return type:

MoneroPrivateKey object

Raises:

MoneroKeyError – If the key constructed from the bytes is not valid

classmethod FromBytes(key_bytes: bytes) MoneroPrivateKey

Create from bytes.

Parameters:

key_bytes (bytes) – Key bytes

Raises:

MoneroKeyError – If the key constructed from the bytes is not valid

m_priv_key: IPrivateKey
KeyObject() IPrivateKey

Return the key object.

Returns:

Key object

Return type:

IPrivateKey object

Raw() DataBytes

Return raw private key.

Returns:

DataBytes object

Return type:

DataBytes object

PublicKey() MoneroPublicKey

Get the public key correspondent to the private one.

Returns:

MoneroPublicKey object

Return type:

MoneroPublicKey object