Questions tagged [der]

Distinguished Encoding Rules (DER) certificate encoding is a method of turning ASN.1 attributes and values into a machine-friendly format.

215 questions
781
votes
12 answers

How to get .pem file from .key and .crt files?

How can I create a PEM file from an SSL certificate? These are the files that I have available: .crt server.csr server.key
Sergio Rodriguez
  • 8,258
  • 3
  • 18
  • 25
317
votes
2 answers

How to convert .crt to .pem

How can I convert .crt to .pem?
Ali
  • 10,774
  • 10
  • 56
  • 83
64
votes
12 answers

Write x509 certificate into PEM formatted string in java?

Is there some high level way to write an X509Certificate into a PEM formatted string? Currently I'm doing x509cert.encode() to write it into a DER formatted string, then base 64 encoding it and appending the header and footer to create a PEM string,…
pizzathehut
  • 665
  • 1
  • 6
  • 5
43
votes
3 answers

ssl : Unable to load certificate

I have 2 files - CSR.csr and newkey.key, both seem to be in PEM format as follows - -----BEGIN CERTIFICATE REQUEST----- MIID.... -----END CERTIFICATE REQUEST----- -----BEGIN RSA PRIVATE KEY----- MI... -----END RSA PRIVATE KEY----- When I'm…
Kat.S
  • 587
  • 2
  • 7
  • 13
23
votes
3 answers

How can I get SecKeyRef from DER/PEM file

I need to integrate my iPhone app with a system, and they require to encrypt data by a given public key, there are 3 files in 3 different format .xml .der and .pem, I have researched and found some articles about getting SecKeyRef from DER/PEM, but…
Son Nguyen
  • 3,481
  • 4
  • 33
  • 47
19
votes
1 answer

Extract public key from certificate in DER format

I have a .cer certificate file, and need to extract the Public Key. I can only extract to PEM format. The "outform" parameter does nothing. openssl x509 -inform PEM -in certificate.cer -outform DER -pubkey -noout > publickey.der Is it possible to…
marcolopes
  • 9,232
  • 14
  • 54
  • 65
14
votes
1 answer

Create PrivateKey and PublicKey from a String base64 encoding with DER format

I have my Private and Public keys in a String in base64 which where encoded using ANS1 DER. I tried creating the instance of a java PrivateKey and PublicKey: byte [] llave2 = DatatypeConverter.parseBase64Binary(key); PKCS8Key pkcs8 = new PKCS8Key(…
user1084509
  • 1,832
  • 10
  • 33
  • 48
13
votes
1 answer

Extract PEM Public Key from X.509 Certificate

I've created what I believe is a certificate containing a Public Key DER file, but I need the Public Key in PEM format now for a different platform. The aim is to use the same public key. I created it using RSA Encryption in iOS and Decrypt It Using…
legoblocks
  • 525
  • 1
  • 6
  • 16
12
votes
1 answer

ASN.1 SEQUENCE tag number encoding

according to for example http://luca.ntop.org/Teaching/Appunti/asn1.html a sequence has the tag number 10 in hexadecimal. But why it is then DER encoded as 30 and not 10? An INTEGER with the tag number 02 in hexadecimal is also encoded as…
Pete
  • 151
  • 1
  • 6
12
votes
3 answers

NodeJS: Validate certificate in DER format

I'm using crypto module to validate a certificate, but both, my certificate and my public key are in DER format. It seems that crypto module does not accept this format. Is there a way (or module) to convert DER to PEM format using NodeJS? I…
blzn
  • 342
  • 1
  • 3
  • 15
11
votes
1 answer

Decoding an ASN.1 DER OCTET STRING with OpenSSL

Using the OpenSSL API, I have extracted a custom extension from a X.509v3 certificate with: X509_EXTENSION* ex = X509_get_ext(x509, 4); The X509_EXTENSION object contains a value (ex->value) that is an ASN.1 OCTET STRING. The OCTET STRING contains…
Roger Dahl
  • 15,132
  • 8
  • 62
  • 82
11
votes
3 answers

Is there a good C++ library to read, create and modify BER encoded files?

There are several tools that can automatically generate C++ (or other) code for reading and writing BER encoded files. In my C++ project, I need libraries to read and modify BER encoded files. I can not generate C++ classes based on a given data…
Daan
  • 2,478
  • 3
  • 36
  • 76
10
votes
1 answer

How can I validate that a certificate really is in DER format?

Is there some kind of digital signature to a DER which would be apparent in a hex editor? I've been given a .cer file with binary content of about 1.3 KB. I'm told that it's in DER format, and my reading suggests that certificates with this…
user565869
8
votes
1 answer

What are different certificate types, formats in Cryptography

We are adding server certificates verification in SSL handshake for one of our clients. Being very new to Cryptography and C world, thought I would first clear my concepts about these things and then start with implementation. So, I googled a lot…
Tushar Sudake
  • 1,148
  • 1
  • 14
  • 25
7
votes
2 answers

How should I interpret the ASN.1 BER standard for REALs?

I have been reading X.690 "Information technology – ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)" In particular, §8.5.6.4 (d), concerning a binary encoding…
Rhubbarb
  • 4,248
  • 6
  • 36
  • 40
1
2 3
14 15