Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3/4 Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(Node.js) Load DER encoded X.509 Certificate (.cer, .crt)Loads a digital certificate from a binary DER encoded X.509 Certificate (.cer, .crt) and fetches information about the cert.
var os = require('os'); if (os.platform() == 'win32') { if (os.arch() == 'ia32') { var chilkat = require('@chilkat/ck-node11-win-ia32'); } else { var chilkat = require('@chilkat/ck-node11-win64'); } } else if (os.platform() == 'linux') { if (os.arch() == 'arm') { var chilkat = require('@chilkat/ck-node11-arm'); } else if (os.arch() == 'x86') { var chilkat = require('@chilkat/ck-node11-linux32'); } else { var chilkat = require('@chilkat/ck-node11-linux64'); } } else if (os.platform() == 'darwin') { var chilkat = require('@chilkat/ck-node11-macosx'); } function chilkatExample() { var cert = new chilkat.Cert(); var success; // LoadFromFile will load virtually any certificate format file. // It will auto-recognize the format and load appropiately. success = cert.LoadFromFile("/Users/chilkat/testData/cer/chilkat_ssl.cer"); if (success !== true) { 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); } chilkatExample(); |
© 2000-2016 Chilkat Software, Inc. All Rights Reserved.