Construct a new key with both private and public keys.
(id: NodeId, private_key_bytes: [u8; 32])
| 175 | impl NodeKey { |
| 176 | /// Construct a new key with both private and public keys. |
| 177 | fn new(id: NodeId, private_key_bytes: [u8; 32]) -> Self { |
| 178 | Self { |
| 179 | id, |
| 180 | private_key_bytes, |
| 181 | did: id.did(), |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | /// Construct a [`JWK`] with both the private and public keys. |
| 186 | pub fn jwk(&self) -> JWK { |