React Native
React Native
Load DER encoded X.509 Certificate (.cer, .crt)
See more Certificates Examples
Loads a digital certificate from a binary DER encoded X.509 Certificate (.cer, .crt) and fetches information about the cert.Chilkat React Native Downloads
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.
try {
cert.loadFromFile('/Users/chilkat/testData/cer/chilkat_ssl.cer');
} catch {
console.log(cert.lastErrorText);
return;
}
// DN = "Distinguished Name"
console.log(`SubjectDN:${cert.subjectDN}`);
console.log(`Common Name:${cert.subjectCN}`);
console.log(`Issuer Common Name:${cert.issuerCN}`);
console.log(`Serial Number:${cert.serialNumber}`);
}