Sample code for 30+ languages & platforms
React Native

Convert Certificate from DER to PEM.

See more Certificates Examples

Loads a digital certificate from any format, such as DER, and saves to PEM format.

Chilkat React Native Downloads

React Native
import { Cert } from '@chilkat/react-native'

function chilkatExample() {
  const cert = new Cert();

  // LoadFromFile will load virtually any certificate format file.
  // It will auto-recognize the format and load appropiately.
  // In this case, load a DER format certificate and convert to PEM.
  try {
    cert.loadFromFile('qa_data/certs/testCert.cer');
  } catch {
    console.log(cert.lastErrorText);
    return;
  }

  try {
    cert.exportCertPemFile('qa_data/certs/testCert.pem');
  } catch {
    console.log(cert.lastErrorText);
    return;
  }

  console.log('Converted certificate from DER to PEM format.');
}