Skip to content

Commit 58b8a27

Browse files
committed
der: add test: optional OCTET/BIT STRING
1 parent c76165b commit 58b8a27

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

der/tests/derive.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,19 @@ mod sequence {
441441
pub typed: &'a [u8],
442442
#[asn1(context_specific = "0")]
443443
pub context_specific: bool,
444+
444445
#[asn1(optional = "true")]
445446
pub optional: Option<bool>,
447+
448+
#[asn1(type = "OCTET STRING", optional = "true")]
449+
pub optional_octet_string: Option<&'a [u8]>,
450+
451+
#[asn1(type = "BIT STRING", optional = "true")]
452+
pub optional_bit_string: Option<&'a [u8]>,
453+
454+
#[asn1(optional = "true")]
455+
pub optional_oid: Option<ObjectIdentifier>,
456+
446457
#[asn1(default = "default_false_example")]
447458
pub default: bool,
448459
#[asn1(type = "BIT STRING", context_specific = "1")]

0 commit comments

Comments
 (0)