Distinguished Encoding Rules (DER) certificate encoding is a method of turning ASN.1 attributes and values into a machine-friendly format.
Questions tagged [der]
215 questions
2
votes
2 answers
Export a certificate in asn.1 notation from X509Certificate2
I'm currently learning working with certificates and now I'm curious, if it is possible to get the ASN.1 notation of a loaded certificate from a X509Certificate2-instance.
I have found the Export-Method and it works fine, however I have not seen a…

HCL
- 36,053
- 27
- 163
- 213
2
votes
2 answers
How to iterate through an complex ASN.1 sequence in C#?
Initial situation
Currently, I am trying to iterate through a complex ASN.1 sequence using the AsnReader class. Most code snippets down below are inspired by a well hidden ASN.1 BER/CER/DER Reader & Writer design document.
The ASN.1 sequence is…

Maik Hasler
- 1,064
- 6
- 36
2
votes
1 answer
How to convert DER to PEM using Nodejs
I want to convert DER content to PEM format using Nodejs.
I couldn't find any suitable library or logic. How can I achieve this?

Gnik
- 7,120
- 20
- 79
- 129
2
votes
1 answer
How to see Page Size in Xcode latest code signature format
I got this message from Apple
An app signed with a codesign version provided on an older macOS, like
Catalina (10.15) will not run on iOS 15 because the latest version you
can install is Xcode 12.4. Xcode 12.5 seems to change the behavior…

Rohit Singh
- 16,950
- 7
- 90
- 88
2
votes
1 answer
How to sign ECDSA signature and encode to DER format in hex in php?
How to sign the Tx data including ETH Keccak256 hashed addresses signature with secp256k1 (ECDSA) keys and encode to DER format in hex and verify in php?
I want to use only php libraries come with, openssl and others, to make secp256k1 private and…

smith john
- 33
- 9
2
votes
0 answers
Extracting Private Key from a DER file
I have a DER certificate file, and using openssl I tried to extract the private key. I tried many commands but none of them would extract the key. I WAS able to extract the certificate, but not the PK.. Any ideas what to do? Many thanks.

Turgut Kalfaoglu
- 101
- 1
- 4
2
votes
1 answer
Return to binary private key secp256k1 from hex DER
I want to get private_key.pem from foo_priv.key
$ openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -out private_key.pem
$ openssl ec -in private_key.pem -outform DER|tail -c +8|head -c 32 |xxd -p -c 32 > foo_priv.key
I tried with
$…

monkeyUser
- 4,301
- 7
- 46
- 95
2
votes
1 answer
Additional Octet String in Bouncycastle signed data message
I am creating a CSCA Master list signed data but after successful creation of it, I see two Octet String instead of one in signed message. Please check the source code and output files
CMS using BC
// load master list signer key
…

user1855673
- 51
- 6
2
votes
1 answer
Convert Private key(string) to DER format using python
I am trying to do client authentication using ssl certificate. I got the private key ( as string ) from keyvault.
As part of the requirement, i need to convert the private key(generated using openssl command) to DER format for snowflake…

SunilS
- 2,030
- 5
- 34
- 62
2
votes
0 answers
Looping Through ASN.1 Sequence Using OpenSSL Libcrypto
Given a sequence object, how can one iterate through the objects inside it? I've tried ASN1_TYPE_unpack_sequence but have no idea how to interpret the objects it returns.
Here is a toy example, the DER encoding of a sequence containing an empty…

Arya Pourtabatabaie
- 705
- 2
- 7
- 22
2
votes
1 answer
Java Exception during signature verification (error decoding signature bytes)
I have to verify a certificate. I'm not an expert of cryptography, so probably I did something (or everything :) ) wrong.
When the code reach the last step (boolean b = sig.verify(CertSign);), it fires an exception: java.security.SignatureException:…

Rudy Barbieri
- 389
- 1
- 4
- 16
2
votes
0 answers
Converting ASN.1 DER to PEM file
Let's assume the following private key (in hex): dd1cd59c4de2fa92e363dac282afe790a5193177d413b38e206b2b86b879ffbf.
I would like to sign a message with this private key via openSSL. OpenSSL requires a pem file as key. So I'm trying to convert the…

user2298995
- 2,045
- 3
- 19
- 27
2
votes
1 answer
How do you encode a post-1994 ASN.1 EXTERNAL type?
Background:
Prior to 1994, EXTERNAL was defined like so (with automatic and explicit tagging):
EXTERNAL ::= [UNIVERSAL 8] IMPLICIT SEQUENCE
{
direct-reference OBJECT IDENTIFIER OPTIONAL,
indirect-reference INTEGER OPTIONAL,
…

Jonathan Wilbur
- 1,057
- 10
- 19
2
votes
1 answer
What is ASN.1 DER tag value 0xA0?
Here is an example of a certificate encoded in ASN.1 DER
30 82 01 8F 30 81 F9 **A0** 03 02 01 02 02 01 01 30
0D 06 09 2A 86 48 86 F7 0D 01 01 05 05 00 30 0D
31 0B 30 09 06 03 55 04 03 0C 02 43 41 30 20 17
0D 31 33 30 39 31 35 31 35 33 35 30 32 5A 18…

alexander.sivak
- 4,352
- 3
- 18
- 27
2
votes
1 answer
Confusion with PEM and DER certificate
I'm developing an iOS app wich uses a third-party framework and SSL.
In order to connect to the server i need to pass a server certificate, a client certificate and a passphrase:
[HostConfiguration hostConfigurationWithAddress:@"demo.server...."
…

Alexander Harl
- 122
- 10