Skip to content

Commit

Permalink
ASN.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar committed Aug 23, 2024
1 parent e0b9409 commit 7aa536a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions blockset-lib/src/asn1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ impl Any {
match self {
Any::Bool(v) => f(v),
Any::Integer(v) => f(v),
Any::ObjectIdentifier(v) => f(v),
_ => todo!(),
}
}
Expand All @@ -67,6 +68,7 @@ impl Any {
match tag {
bool::TAG => Any::Bool(f(a)),
i128::TAG => Any::Integer(f(a)),
ObjectIdentifier::TAG => Any::ObjectIdentifier(f(a)),
_ => todo!(),
}
} else {
Expand Down Expand Up @@ -259,6 +261,14 @@ mod test {
Any::Integer(i128::MIN + 1),
&[2, 16, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
);
any_f(
Any::ObjectIdentifier(ObjectIdentifier {
a0: 2,
a1: 0,
a2: [1, 235].cast(),
}),
&[6, 4, 80, 1, 0x81, 0x6b],
);
}

#[wasm_bindgen_test]
Expand Down

0 comments on commit 7aa536a

Please sign in to comment.