Condividi tramite


SET

Un set contiene una serie non ordinata di campi di uno o più tipi. Viene codificato in un triplo TLV che inizia con un byte tag di 0x31. Nell'esempio seguente, adattato dall'argomento CMC Encoded ASN.1 , viene illustrato come un attributo ClientId viene codificato in una struttura di dati SET . L'attributo può essere specificato usando l'interfaccia IX509AttributeClientId .

31 59                                     ; SET (59 Bytes)
   30 57                                  ; SEQUENCE (57 Bytes)
      06 09                               ; OBJECT_ID (9 Bytes)
      |  2b 06 01 04 01 82 37 15  14      ;   1.3.6.1.4.1.311.21.20 
      31 4a                               ; SET (4a Bytes)
         30 48                            ; SEQUENCE (48 Bytes)
            02 01                         ; INTEGER (1 Bytes)
            |  09
            0c 23                         ; UTF8_STRING (23 Bytes)
            |  76 69 63 68 33 64 2e 6a    ;   vich3d.j
            |  64 6f 6d 63 73 63 2e 6e    ;   domcsc.n
            |  74 74 65 73 74 2e 6d 69    ;   ttest.mi
            |  63 72 6f 73 6f 66 74 2e    ;   crosoft.
            |  63 6f 6d                   ;   com
            0c 15                         ; UTF8_STRING (15 Bytes)
            |  4a 44 4f 4d 43 53 43 5c    ;   JDOMCSC\
            |  61 64 6d 69 6e 69 73 74    ;   administ
            |  72 61 74 6f 72             ;   rator
            0c 07                         ; UTF8_STRING 

Se set contiene meno di 128 byte, il campo Lunghezza del triplo TLV richiede un solo byte per specificare la lunghezza del contenuto. Se è maggiore di 127 byte, il bit 7 del campo Lunghezza è impostato su 1 e i bit da 6 a 0 specificano il numero di byte aggiuntivi utilizzati per identificare la lunghezza del contenuto. Per altre informazioni, vedere Encoded Length and Value Bytes.For more information, see Encoded Length and Value Bytes.

Sistema di tipi ASN.1

Codifica DER dei tipi ASN.1