identity_jose/jws/format.rs
1// Copyright 2020-2023 IOTA Stiftung
2// SPDX-License-Identifier: Apache-2.0
3
4/// The serialization format used for the JWS.
5#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
6pub enum JwsFormat {
7 /// JWS Compact Serialization (<https://www.rfc-editor.org/rfc/rfc7515#section-3.1>).
8 Compact,
9 /// General JWS JSON Serialization (<https://www.rfc-editor.org/rfc/rfc7515#section-7.2.1>).
10 General,
11 /// Flattened JWS JSON Serialization (<https://www.rfc-editor.org/rfc/rfc7515#section-7.2.2>).
12 ///
13 /// Should be used for single signature or MAC use cases.
14 Flatten,
15}
16
17impl Default for JwsFormat {
18 fn default() -> Self {
19 Self::Compact
20 }
21}