Trait rocket::mtls::oid::asn1_rs::TestValidCharset

source ·
pub trait TestValidCharset {
    // Required method
    fn test_valid_charset(i: &[u8]) -> Result<(), Error>;
Available on crate feature mtls only.
Expand description

Base trait for BER string objects and character set validation

This trait is implemented by several types, and is used to determine if some bytes would be valid for the given type.


use asn1_rs::{PrintableString, TestValidCharset, VisibleString};

let bytes: &[u8] = b"abcd*4";
let res = PrintableString::test_valid_charset(bytes);
let res = VisibleString::test_valid_charset(bytes);

Required Methods§


fn test_valid_charset(i: &[u8]) -> Result<(), Error>

Check character set for this object type.

Object Safety§

This trait is not object safe.