Skip to content

Commit f8af14a

Browse files
authored
Merge branch 'km/cose-content-format' into km/cose-key-rotation
2 parents 977a6b5 + e3ee279 commit f8af14a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

crates/bitwarden-crypto/src/keys/signed_public_key.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,20 @@ impl From<SignedPublicKey> for CoseSign1Bytes {
8383
}
8484
}
8585

86-
impl From<SignedPublicKey> for String {
87-
fn from(val: SignedPublicKey) -> Self {
88-
let bytes: CoseSign1Bytes = val.into();
89-
STANDARD.encode(bytes.as_ref())
90-
}
91-
}
92-
9386
impl TryFrom<CoseSign1Bytes> for SignedPublicKey {
9487
type Error = EncodingError;
9588
fn try_from(bytes: CoseSign1Bytes) -> Result<Self, EncodingError> {
9689
Ok(SignedPublicKey(SignedObject::from_cose(&bytes)?))
9790
}
9891
}
9992

93+
impl From<SignedPublicKey> for String {
94+
fn from(val: SignedPublicKey) -> Self {
95+
let bytes: CoseSign1Bytes = val.into();
96+
STANDARD.encode(&bytes)
97+
}
98+
}
99+
100100
impl SignedPublicKey {
101101
/// Verifies the signature of the public key against the provided `VerifyingKey`, and returns
102102
/// the `AsymmetricPublicCryptoKey` if the verification is successful.

0 commit comments

Comments
 (0)