Trait rocket::mtls::x509::der_parser::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.

§Example

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

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

Required Methods§

source

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

Check character set for this object type.

Object Safety§

This trait is not object safe.

Implementors§