x509csr 1.0.2 copy "x509csr: ^1.0.2" to clipboard
x509csr: ^1.0.2 copied to clipboard

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

Make X.509 RSA Certificate Signing Requests (CSR). We include helper functions for generating Keypairs and outputting associated PEMs.

This is moderately barebones, contributions welcome.

The CSR PEM can be verified using

openssl req -text -noout -verify -in csr.pem

Usage #

A simple usage example:

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));
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

See also: #

2
likes
40
pub points
41%
popularity

Publisher

unverified uploader

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

Homepage

License

Apache-2.0 (LICENSE)

Dependencies

asn1lib, pointycastle

More

Packages that depend on x509csr