diff options
Diffstat (limited to 'src/asn1_types/object_descriptor.rs')
-rw-r--r-- | src/asn1_types/object_descriptor.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/asn1_types/object_descriptor.rs b/src/asn1_types/object_descriptor.rs new file mode 100644 index 0000000..db78870 --- /dev/null +++ b/src/asn1_types/object_descriptor.rs @@ -0,0 +1,17 @@ +use crate::{asn1_string, TestValidCharset}; +use crate::{Error, Result}; +use alloc::string::String; + +// X.680 section 44.3 +// ObjectDescriptor ::= [UNIVERSAL 7] IMPLICIT GraphicString + +asn1_string!(ObjectDescriptor); + +impl<'a> TestValidCharset for ObjectDescriptor<'a> { + fn test_valid_charset(i: &[u8]) -> Result<()> { + if !i.iter().all(u8::is_ascii) { + return Err(Error::StringInvalidCharset); + } + Ok(()) + } +} |