IBM Support

An asn.1 encoding/decoding error occurred

Troubleshooting


Problem

When importing a certificate in DCM the following error occurs;

An asn.1 encoding/decoding error occurred. If this file was transferred to this location, check that you used the correct mode. For example, usually the FTP mode binary should be used for binary files and ASCII mode for text files. Newer versions of some PKCS standards may not be supported.

Cause

This error indicates that the format of the file is not correct based on what type of certificate is being imported (CA or Server/Client). DCM supports Base64 and PKCS format types which follow a certain type of formatting. 

Base64 (.cer) is ASCII format will look like the following when viewed with WRKLNK

-----BEGIN CERTIFICATE-----
Wm+O58kHa36hwFOVgongeFxyqGy+Z2ur5zPZh/L4XCf09io7h+/awkfav6zrJ2R7
TFPrNOEvmyBNVBJrfSi9AgMBAAGjggFTMIIBTzAOBgNVHQ8BAf8EBAMCAQYwHQYD
VR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8CAQAw
HQYDVR0OBBYEFKkrh+HOJEc7G7/PhTcCVZ0NlFjmMB8GA1UdIwQYMBaAFGB7ZhpF
DZfKiVAvfQTNNKj//P1LMD0GCCsGAQUFBwEBBDEwLzAtBggrBgEFBQcwAYYhaHR0
-----END CERTIFICATE-----

PKCS (.p12, .pfx, .p7b) is binary data so viewing with WRKLNK will not look like ASCII data.

Diagnosing The Problem

View the file with WRKLNK and compare this to the file that was sent on the PC using Notepad or another text editor for Base64 type certificates. 

Resolving The Problem

To resolve this issue the file will need to be transfer to the IFS properly such as ASCII FTP for Base64 and FTP Binary for PKCS type certificates. Using a mapped drive is another way to transfer files to the IFS for importing however using IBM Navigator for i can cause CCSID transcoding issues resulting in the error described in this document so it's not recommend using this option.

Document Location

Worldwide


[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CISAA2","label":"Digital Certificate Manager"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.3.0;7.4.0;7.5.0"}]

Document Information

More support for:
IBM i

Component:
Digital Certificate Manager

Software version:
7.3.0, 7.4.0, 7.5.0

Operating system(s):
IBM i

Document number:
6202484

Modified date:
06 October 2022

UID

ibm16202484

Manage My Notification Subscriptions