ed25519_keys

Module for ed25519 keys.

class Ed25519KeysConst

Bases: object

Class container for ed25519 keys constants.

PUB_KEY_PREFIX: bytes = b'\x00'
PUB_KEY_BYTE_LEN: int = 32
PRIV_KEY_BYTE_LEN: int = 32
class Ed25519PublicKey(key_obj: VerifyKey)

Bases: IPublicKey

Ed25519 public key class.

classmethod FromBytes(key_bytes: bytes) IPublicKey

Construct class from key bytes.

Parameters:

key_bytes (bytes) – Key bytes

Returns:

IPublicKey object

Return type:

IPublicKey

Raises:

ValueError – If key bytes are not valid

classmethod FromPoint(key_point: IPoint) IPublicKey

Construct class from key point.

Parameters:

key_point (IPoint object) – Key point

Returns:

IPublicKey object

Return type:

IPublicKey

Raises:

ValueError – If key point is not valid

m_ver_key: VerifyKey
static CurveType() EllipticCurveTypes

Get the elliptic curve type.

Returns:

Elliptic curve type

Return type:

EllipticCurveTypes

static CompressedLength() int

Get the compressed key length.

Returns:

Compressed key length

Return type:

int

static UncompressedLength() int

Get the uncompressed key length.

Returns:

Uncompressed key length

Return type:

int

UnderlyingObject() Any

Get the underlying object.

Returns:

Underlying object

Return type:

Any

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

Point() IPoint

Get public key point.

Returns:

IPoint object

Return type:

IPoint object

class Ed25519PrivateKey(key_obj: SigningKey)

Bases: IPrivateKey

Ed25519 private key class.

classmethod FromBytes(key_bytes: bytes) IPrivateKey

Construct class from key bytes.

Parameters:

key_bytes (bytes) – Key bytes

Returns:

IPrivateKey object

Return type:

IPrivateKey

Raises:

ValueError – If key bytes are not valid

m_sign_key: SigningKey
static CurveType() EllipticCurveTypes

Get the elliptic curve type.

Returns:

Elliptic curve type

Return type:

EllipticCurveTypes

static Length() int

Get the key length.

Returns:

Key length

Return type:

int

UnderlyingObject() Any

Get the underlying object.

Returns:

Underlying object

Return type:

Any

Raw() DataBytes

Return raw private key.

Returns:

DataBytes object

Return type:

DataBytes object

PublicKey() IPublicKey

Get the public key correspondent to the private one.

Returns:

IPublicKey object

Return type:

IPublicKey object