/// "STRING" types in ASN.1 BER (OCTET STRING, UTF8 STRING) are either
/// primitive encoded, or in certain variants like CER they are constructed
/// encoded containing primitive encoded chunks.
"STRING" types in ASN.1 BER (OCTET STRING, UTF8 STRING) are either
primitive encoded, or in certain variants like CER they are constructed
encoded containing primitive encoded chunks.
" STRING " types in ASN . 1 BER ( OCTET STRING UTF8 STRING ) are either primitive encoded or in certain variants like CER they are constructed encoded containing primitive encoded chunks .
fn encode_string(&mut self, tag: Tag, nested_tag: Tag, value: &[u8]) -> Result<(), Error> {
        let max_string_length = self.config.encoding_rules.max_string_length();
        if value.len() > max_string_length {
            let ident_bytes = self.encode_identifier(Identifier::from_tag(tag, true));
            self.append_byte_or_bytes(ident_bytes);
            self.output.push(START_OF_CONTENTS);
            for chunk in value.chunks(max_string_length) {
                self.encode_primitive(nested_tag, chunk);
            }
            self.output.extend_from_slice(END_OF_CONTENTS);
            self.encode_to_set(tag);
        } else {
            self.encode_primitive(tag, value);
        }
        Ok(())
    }
fn encode_string ( & mut self , tag : Tag , nested_tag : Tag , value : & [ u8 ] ) -> Result < ( ) , Error > { let max_string_length = self . config . encoding_rules . max_string_length ( ) ; if value . len ( ) > max_string_length { let ident_bytes = self . encode_identifier ( Identifier :: from_tag ( tag , true ) ) ; self . append_byte_or_bytes ( ident_bytes ) ; self . output . push ( START_OF_CONTENTS ) ; for chunk in value . chunks ( max_string_length ) { self . encode_primitive ( nested_tag , chunk ) ; } self . output . extend_from_slice ( END_OF_CONTENTS ) ; self . encode_to_set ( tag ) ; } else { self . encode_primitive ( tag , value ) ; } Ok ( ( ) ) }
"STRING" types in ASN.1 BER (OCTET STRING, UTF8 STRING) are either
primitive encoded, or in certain variants like CER they are constructed
encoded containing primitive encoded chunks.
" STRING " types in ASN . 1 BER ( OCTET STRING UTF8 STRING ) are either primitive encoded or in certain variants like CER they are constructed encoded containing primitive encoded chunks .
&mut self
tag
Tag
nested_tag
Tag
value
&[u8]