Dart Requires Chilkat v11.0.0+
Dart
Get Certificate's Public Key
Loads a certificate from PEM and gets the public key.Chilkat Dart Downloads
import 'package:chilkat/chilkat.dart';
void main() {
final cert = CkCert();
final strPem = '-----BEGIN CERTIFICATE----- ...';
try {
cert.loadPem(strPem);
} on ChilkatException catch (e) {
print(e.lastErrorText);
return;
}
final pubKey = CkPublicKey();
cert.getPublicKey(pubKey);
// You can now use the public key object however it is needed,
// and access its various properties and methods..
print(pubKey.getXml());
}