will help you Sure. MIME::Types lets you specify custom types. Stick this into an initializer
# Not quite sure what the appropriate MIMEtype for PSDs are,
# but this is the gist of it.
# .PSB is a larger version of .PSD supporting up to 300000x300000 px
psd_mime_type = MIME::Type.new('image/x-photoshop') do |t|
t.extensions = %w(psd psb)
t.encoding = '8bit'
M2Crypto: extract message from opaque signed S/MIME (pkcs7-mime)
around this issue What I think is the main misunderstanding here is that in the case of MIME types other than "multipart/signed", smime_load_pkcs7() is meant to return None in the second part of the tuple, and SMIME.SMIME.verify() is meant to take None for its second parameter. When you call s.verify(a, b), it doesn't mean "verify that the signature in a matches the message b", it means "verify that the PKCS7 structure a has a valid signature, given the x509 store and stack on the SMIME object s. Oh, and if a has a detached message, you can find the message part in b."
wish helps you You get this error because, sure enough, there is no from_str method defined on Mime. In order to resolve a name like Mime::from_str, from_str has to be either an inherent method of Mime (not part of a trait), or part of a trait that is in scope in the place where it's used. FromStr isn't in scope, so you get an error -- although the error message goes so far as to tell you what's wrong and how to fix it:
error[E0599]: no function or associated item named `from_str` found for type `hyper::<unnamed>::Mime` in the current scope
3 | let test1 = hyper::mime::Mime::from_str("text/html+xml").unwrap();
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:
candidate #1: `use std::str::FromStr;`
let test1: hyper::mime::Mime = "text/html+xml".parse().unwrap();