Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use choice #138

Open
koshi148 opened this issue May 11, 2023 · 0 comments
Open

How to use choice #138

koshi148 opened this issue May 11, 2023 · 0 comments

Comments

@koshi148
Copy link

I don't know how to use choice tag.
The code below gives me an error and I can't encode it.

const asn1 = require('asn1.js');
const Message = asn1.define('Message', function () {
    this.choice({
        aaa: this.utf8str()
    })
});
const encoded = Message.encode({
        aaa: '5'    
}, 'der');
console.log(encoded);

So I need a simple example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant