You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i'm trying to create a sample TimeStampResp, but for some reason the const OID_CONTENT_TYPE_TST_INFO cannot be assigned to the content_type of the TimeStampToken.
It fails on the content_type, it's probably a stupid thing but I can't get it to work. Even assigning it to a temp Oid via Oid::<Bytes>::from(OID_CONTENT_TYPE_TST_INFO.0); didn't work. It seems that content_type and the const are of a different type but I'm unable to grasp why that is or how to convert one into the other.
You can try using the Constructed::decode() function from bcder to materialize a deserialized ASN.1 value from its bytes. In this case you want to feed in the raw bytes of an OID and parse into an Oid instance.
This is super inefficient but it seems to be one of the few ways you can coerce types in bcder.
You could also try Oid(Bytes::copy_from_slice(...)) to initialize an Oid from a Bytes created from an &[u8]. I do this a bunch in my apple-codesign crate.
Hi, i'm trying to create a sample TimeStampResp, but for some reason the const OID_CONTENT_TYPE_TST_INFO cannot be assigned to the content_type of the TimeStampToken.
It fails on the content_type, it's probably a stupid thing but I can't get it to work. Even assigning it to a temp Oid via
Oid::<Bytes>::from(OID_CONTENT_TYPE_TST_INFO.0);
didn't work. It seems that content_type and the const are of a different type but I'm unable to grasp why that is or how to convert one into the other.The text was updated successfully, but these errors were encountered: