use oid::prelude::*;
fn main() -> Result<(), ObjectIdentifierError> {
let oid_string = "0.1.2.3";
println!("OID String Test Value: {oid_string}");
let oid = ObjectIdentifier::try_from(oid_string)?;
println!("OID from String: {oid:#?}");
let oid_string2: String = (&oid).into();
assert_eq!(oid_string, oid_string2);
println!("OID String Encoded Value: {oid_string2}");
println!("\n");
let oid_bytes = vec![0x01, 0x02, 0x03];
println!("OID Binary Test Value: {oid_bytes:?}");
let oid = ObjectIdentifier::try_from(oid_bytes.clone())?;
println!("OID from Binary: {oid:#?}");
let oid_bytes2: Vec<u8> = (&oid).into();
assert_eq!(oid_bytes, oid_bytes2);
println!("OID Binary Encoded Value: {oid_bytes2:?}");
Ok(())
}