Utils
convert_der_to_rsv(signature, v_adjustment_factor=0)
¶
Convert DER signature to RSV format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
signature
|
bytes
|
The DER-encoded signature bytes |
required |
v_adjustment_factor
|
int
|
The v value adjustment factor for the signature |
0
|
Returns:
Name | Type | Description |
---|---|---|
SignatureComponents |
dict
|
A dictionary containing the r, s, and v components |
Raises:
Type | Description |
---|---|
ValueError
|
If the signature is invalid or cannot be decoded |
Source code in web3_google_hsm/utils.py
extract_public_key_bytes(pem_str)
¶
Extract raw public key bytes from PEM format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pem_str
|
str
|
PEM-encoded public key string |
required |
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
Raw public key bytes (64 bytes of X,Y coordinates) |
Raises:
Type | Description |
---|---|
ValueError
|
If the PEM string is invalid |