x509csr 1.0.2

Dart native js
Flutter Android iOS web

Create X.509 Certificate Signing Requests, plus associated PEM helper functions.

example/x509csr.dart

/*
 *  example/x509csr.dart
 *
 *  David Janes
 *  2019-03-15
 */
import "package:x509csr/x509csr.dart";

import "package:pointycastle/export.dart";
import "package:asn1lib/asn1lib.dart";

main(List<String> arguments) {
  AsymmetricKeyPair keyPair = rsaGenerateKeyPair();

  ASN1ObjectIdentifier.registerFrequentNames();
  Map<String, String> dn = {
    "CN": "www.davidjanes.com",
    "O": "Consensas",
    "L": "Toronto",
    "ST": "Ontario",
    "C": "CA",
  };

  ASN1Object encodedCSR = makeRSACSR(dn, keyPair.privateKey, keyPair.publicKey);

  print(encodeCSRToPem(encodedCSR));
  print(encodeRSAPublicKeyToPem(keyPair.publicKey));
  print(encodeRSAPrivateKeyToPem(keyPair.privateKey));
}
0
likes
90
pub points
70%
popularity

Create X.509 Certificate Signing Requests, plus associated PEM helper functions.

Homepage

Documentation

API reference

Uploader

davidjanes@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

asn1lib, pointycastle

More

Packages that depend on x509csr