File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -119,11 +119,18 @@ impl ObjectIdentifier {
119
119
120
120
/// Parse an OID from from its BER/DER encoding.
121
121
pub fn from_bytes ( ber_bytes : & [ u8 ] ) -> Result < Self > {
122
- ObjectIdentifierRef :: from_bytes ( ber_bytes) ? . try_into ( )
122
+ Self :: from_bytes_sized ( ber_bytes)
123
123
}
124
124
}
125
125
126
126
impl < const MAX_SIZE : usize > ObjectIdentifier < MAX_SIZE > {
127
+ /// Parse an OID from from its BER/DER encoding.
128
+ ///
129
+ /// Returns `Err(Error::Length)` if bytes do not fit in `MAX_SIZE`.
130
+ pub fn from_bytes_sized ( ber_bytes : & [ u8 ] ) -> Result < Self > {
131
+ ObjectIdentifierRef :: from_bytes ( ber_bytes) ?. try_into ( )
132
+ }
133
+
127
134
/// Get the BER/DER serialization of this OID as bytes.
128
135
///
129
136
/// Note that this encoding omits the ASN.1 tag/length, and only contains the value portion of
You can’t perform that action at this time.
0 commit comments