encode_asn1_data
Encodes an ASN.1 value string into hex or base64 encoded binary data according to the provided schema definition, ASN.1 type name, and encoding rule (DER by default).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"schemaContent": "<schemaContent>",
"typeName": "<typeName>",
"value": "<value>"
},
"name": "encode_asn1_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| codec | No | The ASN.1 encoding rule to use for encoding. Valid options include 'DER', 'BER', 'PER', 'UPER' or 'CUPER', 'OER' or 'COER', 'JER', 'XML or 'XER' or 'EXER'. Defaults to 'DER'. | DER |
| value | Yes | The ASN.1 value string to be encoded (e.g., in ASN.1 value notation). | |
| userId | No | The user's email address to look up the asn1.io user account. If unknown, pass an empty string. | |
| fileName | No | The name of the schema file. This should end in '.asn' (e.g., 'Rocket.asn'). If not provided, defaults to 'schema.asn'. | schema.asn |
| typeName | Yes | The ASN.1 type name (PDU) to encode (e.g., 'Rocket'). | |
| dataFormat | No | Desired format of the output encoded data: 'hex' or 'base64'. Defaults to 'hex'. | hex |
| schemaContent | Yes | Plain-text ASN.1 schema definition. This must be valid ASN.1 syntax, typically starting with the 'DEFINITIONS' keyword and concluding with 'END'. |