fireblocks_sdk/models/pre_hash.rs
1// Fireblocks API
2//
3// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
4//
5// The version of the OpenAPI document: 1.8.0
6// Contact: developers@fireblocks.com
7// Generated by: https://openapi-generator.tech
8
9use {
10 crate::models,
11 serde::{Deserialize, Serialize},
12};
13
14/// PreHash : The prehash object for ECDSA RAW signing requests. The prehash
15/// object contains the content to sign (the actual message in hex
16/// representation) and the hashing algorithm to use before signing.
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct PreHash {
19 /// The prehashed content to sign on in hex representation.
20 #[serde(rename = "content")]
21 pub content: String,
22 /// The hashing algorithm to use in order to hash the content before the
23 /// signature process
24 #[serde(rename = "hashAlgorithm")]
25 pub hash_algorithm: HashAlgorithm,
26}
27
28impl PreHash {
29 /// The prehash object for ECDSA RAW signing requests. The prehash object
30 /// contains the content to sign (the actual message in hex representation)
31 /// and the hashing algorithm to use before signing.
32 pub fn new(content: String, hash_algorithm: HashAlgorithm) -> PreHash {
33 PreHash {
34 content,
35 hash_algorithm,
36 }
37 }
38}
39/// The hashing algorithm to use in order to hash the content before the
40/// signature process
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum HashAlgorithm {
43 #[serde(rename = "SHA256")]
44 Sha256,
45 #[serde(rename = "KECCAK256")]
46 Keccak256,
47 #[serde(rename = "SHA3")]
48 Sha3,
49 #[serde(rename = "BLAKE2")]
50 Blake2,
51 #[serde(rename = "DOUBLE_SHA256")]
52 DoubleSha256,
53}
54
55impl Default for HashAlgorithm {
56 fn default() -> HashAlgorithm {
57 Self::Sha256
58 }
59}