Trait x509_parser::traits::FromDer [−][src]
Expand description
Parse a DER-encoded object, and return the remaining of the input and the built object.
The returned object uses zero-copy, and so has the same lifetime as the input.
Note that only parsing is done, not validation (see the Validate
trait).
Example
To parse a certificate and print the subject and issuer:
let res = X509Certificate::from_der(DER); match res { Ok((_rem, x509)) => { let subject = x509.subject(); let issuer = x509.issuer(); println!("X.509 Subject: {}", subject); println!("X.509 Issuer: {}", issuer); }, _ => panic!("x509 parsing failed: {:?}", res), }