can somebody please explain when an "enum" variable is used vs when a "choice" variable is used in ASN1 ?
difference between "enum" and "choice" type in ASN1
847 views Asked by siri gowtham At
2
There are 2 answers
0
YaFred
On
CHOICE is richer because the alternatives can be whatever type you want.
PreferredContactMethod ::= CHOICE {
mail PrintableString,
identity SEQUENCE {
firstName PrintableString,
lastName PrintableString
}
}
However, you are right. You could use a CHOICE to define a enumeration (you could also use named INTEGERs) ...
Colors ::= ENUMERATED {red, green, blue, yellow, purple}
Colors ::= INTEGER {red(0), green(1), blue(2), yellow(3), purple(4)}
Colors ::= CHOICE {red NULL, green NULL, blue NULL, yellow NULL, purple NULL}
I have seen the 3 ways used in specifications (note that the encoding will be different)
My 2 cents: if your type is clearly an enumeration, use ENUMERATED
Related Questions in ASN.1
- Error porting ASN1C source files from PC to STM32 (ARM)
- How to encode objects to OER via BouncyCastle in java?
- Apply ASN.1 schema to provide interpretation of ASN.1 encoded data
- Why does `openssl asnparse` not give an error but `openssl x509` does for a DER file?
- PER encoding of BIT STRING with named bits and extensible size constraint
- How to decode PKCS#7/ASN.1 using Javascript?
- How to Go asn1 marshal/unmarshal and omit fields?
- Multiple PDU Types Possible in SNMP Packet?
- Go unmarshal asn failing
- Retrieve value stored against an OID from inside SAN in golang
- What is the semantic difference between SEQUENCE OF and SET OF in ASN.1?
- Can an ASN.1 DER SET have multiple entries of same key?
- Work with more than 2 different structures in ASN.1 (C++) with asn1c compiler
- Explanation of the UPER encoding of an extensible sequence
- How to add DirName and serial to X509v3 Authority Key Identifier
Related Questions in LTE
- Availability of parameter "upperLayerIndication-r15"
- AWS GreenGrass network data usage
- How can I relate a cellular towers CID with it PCI
- GSM and LTE-M connection with SIM7070G for MQTT data transmission
- Extension of lte connectivity, usrp
- "Simcom A7670G GSM Module: Failing to Send Large Data Payload via AT Commands from Raspberry Pi"
- AT commands to avoid data connection and related charge
- AT Command Equivalents to libqmi
- azure-sdk-for-c-arduino ESP32 with SIM7600CE unable to send MQTT's
- Usage of RX interface in LTE and QCI
- How find the LTE bandwidth in Android
- Which CQI table should i choose for CQI value from telephony manager api
- SARA-R5 AWS Unable to connect
- A7672E AT-commands for GPS and bluetooth problem
- Why am I getting incomplete geolocation data for long periods of time using SIM7070g?
Related Questions in 4G
- How to "Enable mobile data" on a Huawei E3372 4G USB dongle using a bash script in Windows
- Availability of parameter "upperLayerIndication-r15"
- Establishing data connection using SORACOM Onyx LTE USB modem in linux
- GSM 7600 Series AT Command (CEREG)
- Kivymd and Requests Android Problem with "requests.get(url, cookies=cookie)" on some mobile 4g networks not working
- Trying to access IP camera that is connected to wifi network on android 9 device
- AT command response handler
- Which CQI table should i choose for CQI value from telephony manager api
- Does LTE-M1 work when RSRP is below thermal noise?
- Port forwarding not working on Huawei B535-232 4G LTE router for ssh connection
- TCP connections terminate after some time on 4G hotspot
- SIMCOM A7600E, can't make voice call but sms works
- How can I disable/enable wifi and 3G/4G data internet programmatically in Android?
- 4G USB Dongle Auto Reconnect / Auto Recover
- Is SMS Over IMS That Important
Related Questions in 3GP
- Issue with repairing 3GP video using untrunc - Error: bad track: 's263'
- How to convert a WAV file into a 3gp in Android using MediaCodec
- Has anyone overcome low-quality issues with .3gpp?
- 3gp file not playing audio in chrome
- How to build ffmpeg to get the smallest static library? I only want convert 3gp to mp4
- 3GP video with "jpeg" video codec
- Write .3gp file into .wav format python Flask server
- difference between "enum" and "choice" type in ASN1
- 3GPP Cell ID and Cell Type
- Problems saved as 3gp files when screen recording on Android9
- How to receive 3gp file from android and decode it using python?
- How to upload audio (3gp) file to firebase storage?
- How to programatically download a video?
- Fixing a corrupted .MP4 file. which might be a 3gp file
- Convert 3gp files to Ogg Vorbis?
Related Questions in 5G
- Is there a way to collect private 5G RSSI & Mac Address(or other identificator) on Android (or else)?
- Availability of parameter "upperLayerIndication-r15"
- Which CQI table should i choose for CQI value from telephony manager api
- Unable to Retrieve NR CellSignalStrength on 5G NSA Mode Using Telephony in OnePlus 8T 5G
- Support Of Ngap and Nr-Rrc protocols filtering using SCAPY
- How to run softmodem for OpenAirInterface (OAI) 5G SA on bladeRF A4
- Kubernetes: error building connection between pod to pod when `hostNetwork=true` is enabled
- How to get standalone5G network type in iOS
- Does the 5G User Plane Function (UPF) supports multiple network slices? And if so how does it ensure the Qos?
- ERROR: Dependency "talloc" not found, tried pkgconfig; How to install talloc dependency on Ubuntu 20.04?
- Worker Node group doesn't join the EKS cluster
- Information about the secondary cell when using android?
- How to know which type of network I'm using in a USB modem 4G,4G+ or 5G?
- How check if current network connected is WIFI 5G?
- Kubernetes pod running only when starting it inside the container
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
An ENUMERATED type in ASN.1 is a used when you have a list of named items you would like to choose from such as
A CHOICE type is used when you would like to choose between different ASN.1 types.
Only one item in the choice can be selected at a time.