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
846 Views Asked by siri gowtham At
2
There are 2 best solutions below
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
- Sample X509 Certificates with Wrong ASN.1 Encode
- ASN1 Structure Encoding
- Is it possible to Develop ASN.1 protocol in Embedded c for 32-bit microcontroller (without OS)?
- Retrieve Subject alternative names of X.509 certificate in java
- Is phpseclib ASN1 biginteger in MATH_BIGINTEGER_MODE_GMP incompatible with standard implementation?
- JASN1 decoding ASN java.io.IOException: Length is out of bound
- ASN.1 definitions for basic SNMP exchanges
- How to extract the Email from a X509 Certificate in .NET?
- How to parse the ASN.1 object and get the data using bouncycastle in java
- How do I convert a private key from hexadecimal to a PrivateKey object?
- cast RSAPrivateKey to PrivateKey and vice versa
- Is asn.1 code endianess independent?
- c# - Custom JSON similar configuration file
- The ASN.1 structure iterator just be declared but not implemented
- Unknown tag encountered parsing AttributeCertificate from DER file with BouncyCastle
Related Questions in LTE
- App can't access internet connection when connected to LTE
- LTE: how eNodeB selects a MME (FIRST attach)?
- Combine $lte and $gte in mongodb for random sample from unknown source doc size
- Detecting cellular network using connman
- Starting with iOS 14 or 14.0.1 WiFi works but LTE does NOT
- untrusted Non-3GPP access in LTE - how ePDG request for Qos rule to PCRF in PMIP
- eCGI and CGI for LTE and GSM networks
- Android Development CellID in LTE network
- How to simulate two OFDM Users with low complexity FFT/IFFT?
- Are there any way to upload locations from background frequently using 3G/4G/LTE?
- Usage of RX interface in LTE and QCI
- AT Command Equivalents to libqmi
- azure-sdk-for-c-arduino ESP32 with SIM7600CE unable to send MQTT's
- AT commands to avoid data connection and related charge
- "Simcom A7670G GSM Module: Failing to Send Large Data Payload via AT Commands from Raspberry Pi"
Related Questions in 4G
- Apache Cordova broadband
- IOS 10 force use 3G-4G instead WIFI
- URLSessionDataTask without response on iPhone 7 network 4g
- Device management tools for IOT/M2M which supports telecom and IOT devices
- Does IOS support simultaneous wifi and 3g/4g connections?
- Error Loading PHP Page On 4G
- How to determine the iOS connection type (Edge, 3G, 4G, Wifi)?
- Using 4G to provide redundancy
- JMDNS is not working with 4G connection?
- How to check whether a particular device supports 4G networks in Android?
- Is SMS Over IMS That Important
- 4G USB Dongle Auto Reconnect / Auto Recover
- C# Connect to mobile network using 4G Dongle APN
- Android - Cannot connect to external IP address over mobile 3G/4G network using sockets
- Android App crashes on 4G internet connection but works fine on GSM mode Only
Related Questions in 3GP
- Android 3gp to mp4 converter
- Copy 3gp moov atom from one file to another
- How to tell if .3gp file is audio or video in android
- 3gp file not playing audio in chrome
- Write .3gp file into .wav format python Flask server
- Fix 3GP file after streaming from Android Media Recorder
- How to play mpg/3gp 5 sec video at start of application?
- 3GP video with "jpeg" video codec
- difference between "enum" and "choice" type in ASN1
- iPhone SDK - Converting .mov to .3gp
- Play Youtube video in MPMoviePlayerController or play RTSP - 3GP link
- how to add text watermark and convert video to 3gp with FFMPEG?
- How to make 3gp from audio and image in Android?
- Playing video in Gmail
- Splitting/Merging 3gp files using a java library
Related Questions in 5G
- Cannot detect CellInfo NR on Samsung S20
- Kubernetes pod running only when starting it inside the container
- How check if current network connected is WIFI 5G?
- android, how can I judge the 5G NSA or SA?
- Force 5G on SIM8200EA-M2
- Is there any way to set up a proxy on Android device to intercept an application traffic by a computer that is not connected to network?
- How to detect the 5G(NR) on iOS14?
- Android 11 5G fetching Cell Parameters
- How to programmatically determine if phone has 5G hardware capability?
- Does the 5G User Plane Function (UPF) supports multiple network slices? And if so how does it ensure the Qos?
- difference between "enum" and "choice" type in ASN1
- How to get the physical channel configuration of the cellphone via programming
- Measuring 5G(New Radio) data
- Is there a way to make a CellInfoNr to CellSignalStrengthNr?
- 5G Core APIs and Backward Incompatible Changes
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)
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?
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.